Sql Server 数据类型与 C# 数据类型对照

 

Sql ServerC#简写
bigintSystem.Int64long
tinyintSystem.Bytebyte
binary(50)System.Byte[]byte[]
imageSystem.Byte[]byte[]
varbinary(50)System.Byte[]byte[]
timestampSystem.Byte[]byte[]
bitSystem.Booleanbool
char(10)System.Stringstring
nchar(10)System.Stringstring
ntextSystem.Stringstring
nvarchar(50)System.Stringstring
varchar(50)System.Stringstring
textSystem.Stringstring
dateSystem.DateTimeSystem.DateTime
datetimeSystem.DateTimeSystem.DateTime
datetime2(7)System.DateTimeSystem.DateTime
smalldatetimeSystem.DateTimeSystem.DateTime
datetimeoffset(7)System.DateTimeOffsetSystem.DateTimeOffset
time(7)System.TimeSpanSystem.TimeSpan
decimal(18,0)System.Decimaldecimal
moneySystem.Decimaldecimal
numeric(18,0)System.Decimaldecimal
smallmoneySystem.Decimaldecimal
floatSystem.Doubledouble
intSystem.Int32int
realSystem.Singlefloat
smallintSystem.Int16short

相关文章