sql server 2008中的geography 数据类型对应c#中的什么类型
1个回答
展开全部
数据库数据类型在C#中的对应
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
public string ParaChange(string strFlg)
{
switch (strFlg.ToLower())
{
case "bigint": return "Int64";
case "binary": return "Byte[]";
case "bit": return "Boolean";
case "char": return "String";
case "date": return "String";
case "datetime": return "DateTime";
case "datetime2": return "String";
case "datetimeoffset": return "String";
case "decimal": return "Decimal";
case "float": return "Double";
case "geography": return "Byte[]";
case "geometry": return "Byte[]";
case "hierarchyid": return "Byte[]";
case "image": return "Byte[]";
case "int": return "Int32";
case "money": return "Decimal";
case "nchar": return "String";
case "ntext": return "String";
case "numeric": return "Decimal";
case "nvarchar": return "String";
case "real": return "Single";
case "smalldatetime": return "DateTime";
case "smallint": return "Int16";
case "smallmoney": return "Decimal";
case "sql_variant": return "Object";
case "text": return "String";
case "time": return "String";
case "timestamp": return "Byte[]";
case "tinyint": return "Byte";
case "uniqueidentifier": return "Guid";
case "varbinary": return "Byte[]";
case "varchar": return "String";
case "xml": return "String";
default: return "Object";
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
public string ParaChange(string strFlg)
{
switch (strFlg.ToLower())
{
case "bigint": return "Int64";
case "binary": return "Byte[]";
case "bit": return "Boolean";
case "char": return "String";
case "date": return "String";
case "datetime": return "DateTime";
case "datetime2": return "String";
case "datetimeoffset": return "String";
case "decimal": return "Decimal";
case "float": return "Double";
case "geography": return "Byte[]";
case "geometry": return "Byte[]";
case "hierarchyid": return "Byte[]";
case "image": return "Byte[]";
case "int": return "Int32";
case "money": return "Decimal";
case "nchar": return "String";
case "ntext": return "String";
case "numeric": return "Decimal";
case "nvarchar": return "String";
case "real": return "Single";
case "smalldatetime": return "DateTime";
case "smallint": return "Int16";
case "smallmoney": return "Decimal";
case "sql_variant": return "Object";
case "text": return "String";
case "time": return "String";
case "timestamp": return "Byte[]";
case "tinyint": return "Byte";
case "uniqueidentifier": return "Guid";
case "varbinary": return "Byte[]";
case "varchar": return "String";
case "xml": return "String";
default: return "Object";
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |