|
|
Sql类型与.Net(C#)类型对应关系表(转)
作者:C/S原创 发布日期:2011/03/17 22:26:31
|
SQL Server |
C# |
NullValue |
|
|
数据类型 |
数据类型 |
空值代替值 |
|
bigint |
Int64 |
Int64.MinValue |
|
binary |
Byte[] |
null |
|
bit |
bool |
-1 |
|
char |
string |
null |
|
datetime |
DateTime |
1753-01-01 0:00:00 |
|
decimal |
Decimal |
Decimal.MinValue |
|
float |
Double |
Double.MinValue |
|
image |
Byte[] |
null |
|
int |
int |
-2147483648 |
|
money |
Single |
Single.MinValue |
|
nchar |
string |
null |
|
ntext |
string |
null |
|
numeric |
Decimal |
Decimal.MinValue |
|
nvarchar |
string |
null |
|
real |
Single |
Single.MinValue |
|
smalldatetime |
DateTime |
1900-01-01 0:00:00 |
|
smallint |
Int16 |
Int16.MinValue |
|
smallmoney |
Single |
Single.MinValue |
|
sql_variant |
Object |
null |
|
text |
string |
null |
|
timestamp |
Byte[] |
null |
|
tinyint |
Byte |
Byte.MinValue |
|
uniqueidentifier |
Guid |
Guid.Empty |
|
varbinary |
Byte[] |
null |
|
varchar |
string |
|
|
旗舰版V5.1
(作者推荐)
轻量框架V2.1
(2021 release)
|
< img id="bigimg" style="border:5px solid #fff;" src="" />