<summary>///data types in the database and in C #//</summary>///<param name= "type" ></param>///<returns ></returns>private string Changetocsharptype (String type) {string Reval = string. Empty; Switch (type. ToLower ()) {case "int": Reval = "Int32"; Break Case "text": Reval = "String"; Break Case "bigint": Reval = "Int64"; Break Case "binary": Reval = "system.byte[]"; Break Case "bit": Reval = "Boolean"; Break Case "char": Reval = "String"; Break Case "datetime": Reval = "System.DateTime"; Break Case "decimal": Reval = "System.Decimal"; Break Case "float": Reval = "System.Double"; Break Case "image": Reval = "system.byte[]"; Break Case ' money ': REval = "System.Decimal"; Break Case "nchar": Reval = "String"; Break Case "ntext": Reval = "String"; Break Case "Numeric": Reval = "System.Decimal"; Break case "nvarchar": Reval = "String"; Break Case "real": Reval = "System.Single"; Break Case "smalldatetime": Reval = "System.DateTime"; Break Case "smallint": Reval = "Int16"; Break Case "SmallMoney": Reval = "System.Decimal"; Break Case "Timestamp": Reval = "System.DateTime"; Break Case "tinyint": Reval = "System.Byte"; Break Case "uniqueidentifier": Reval = "System.Guid"; Break Case "varbinary": Reval = "system.byte[]"; Break Case "varchar": Reval = "STring "; Break Case "Variant": Reval = "Object"; Break Default:reval = "String"; Break } return Reval;}
C # and SQL Server type conversions