SQL Server |
C # |
Shorthand |
bigint |
System.Int64 |
Long |
tinyint |
System.Byte |
Byte |
Binary (50) |
System.byte[] |
Byte[] |
Image |
System.byte[] |
Byte[] |
varbinary (50) |
System.byte[] |
Byte[] |
Timestamp |
System.byte[] |
Byte[] |
Bit |
System.Boolean |
bool |
CHAR (10) |
System.String |
String |
NCHAR (10) |
System.String |
String |
ntext |
System.String |
String |
nvarchar (50) |
System.String |
String |
varchar (50) |
System.String |
String |
Text |
System.String |
String |
Date |
System.DateTime |
System.DateTime |
Datetime |
System.DateTime |
System.DateTime |
DateTime2 (7) |
System.DateTime |
System.DateTime |
smalldatetime |
System.DateTime |
System.DateTime |
DateTimeOffset (7) |
System.datetimeoffset |
System.datetimeoffset |
Time (7) |
System.TimeSpan |
System.TimeSpan |
Decimal (18,0) |
System.Decimal |
Decimal |
Money |
System.Decimal |
Decimal |
Numeric (18,0) |
System.Decimal |
Decimal |
SmallMoney |
System.Decimal |
Decimal |
Float |
System.Double |
Double |
Int |
System.Int32 |
Int |
Real |
System.Single |
Float |
smallint |
System.Int16 |
Short |
SQL Server data Types vs. C # data types