The correspondence between SQL Server and C # data types in C #

xiaoxiao2021-03-06  64

///

/// database with C # data type control /// /// /// Private string ChangeToCsharPType (string us) {string revAL = string.empty; switch (type "int": rema = "int32"; Break; Case "text": rema = "string"; Case "Bigint": Reval = "INT64"; Break; Case "binary": rema = "system.byte []"; break; case "bit": rema = "boolean"; break; case "char": Reval = "String"; break; case "datetime": rema = "system.datetime"; break; case "decimal": rema = "system.decimal"; break; case "float": revAL = "system.double"; break Case "image": rema = "system.byte []"; break; case "money": rema = "system.decimal"; break; case "nchar": revAL = "string"; break; casse "ntext" : Rema = "string"; break; case "numeric": rema = "system.decimal"; break; case "nvarchar": rema = "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": rema = "string"; break; case "variant": Reval = "object"; break; default: revAL = "string"; Break;} return revAl;

转载请注明原文地址:https://www.9cbs.com/read-119722.html

New Post(0)