Private string changetocsharptype (string type)
{
String reval = string. empty;
Switch (type. tolower ())
{
Case "int ":
Reval = "int32"; // int
Break;
Case "text ":
Reval = "string"; // string
Break;
Case "bigint ":
Reval = "int64"; // long
Break;
Case "binary ":
Reval = "system. byte []"; // byte []
Break;
Case "bit ":
Reval = "Boolean"; // bool
Break;
Case "char ":
Reval = "string"; // string
Break;
Case "datetime ":
Reval = "system. datetime ";
Break;
Case "decimal ":
Reval = "system. Decimal"; // decimal
Break;
Case "float ":
Reval = "system. Double"; // double
Break;
Case "image ":
Reval = "system. byte []"; // byte []
Break;
Case "money ":
Reval = "system. Decimal"; // decimal
Break;
Case "nchar ":
Reval = "string ";
Break;
Case "ntext ":
Reval = "string ";
Break;
Case "numeric ":
Reval = "system. Decimal"; // decimal
Break;
Case "nvarchar ":
Reval = "string ";
Break;
Case "real ":
Reval = "system. Single"; // float
Break;
Case "smalldatetime ":
Reval = "system. datetime ";
Break;
Case "smallint ":
Reval = "int16"; // short
Break;
Case "smallmoney ":
Reval = "system. Decimal"; // decimal
Break;
Case "timestamp ":
Reval = "system. datetime ";
Break;
Case "tinyint ":
Reval = "system. Byte"; // byte
Break;
Case "uniqueidentifier ":
Reval = "system. guid ";
Break;
Case "varbinary ":
Reval = "system. byte []"; // byte []
Break;
Case "varchar ":
Reval = "string"; // string
Break;
Case "variant ":
Reval = "object"; // object
Break;
Default:
Reval = "string"; // string
Break;
}
Return reval;
}
Http://www.pcvc.net/category/6.html