SQL Server中类型与.NET中类型的转换对照表

有的时候我们需要将SqlServer中的类型转换为.NET中的类型,或者反过来。那么类型到底如何对应呢?对照表如下:

SQL Server 类型   .NET 基本类型
int Int32
text String
bigint Int64
binary System.Byte[]
bit Boolean
char String
datetime System.DateTime
decimal System.Decimal
float System.Double
image System.Byte[]
money System.Decimal
nchar String
ntext String
numeric System.Decimal
nvarchar String
real System.Single
smalldatetime System.DateTime
smallint Int16
smallmoney System.Decimal
timestamp System.DateTime
tinyint System.Byte
uniqueidentifier System.Guid
varbinary System.Byte[]
varchar String
Variant Object
.NET和SQL Server的类型对照表

 

Tuesday, May 22, 2012 | .NET技术

文章评论

No comments posted yet.

发表评论

Please add 8 and 7 and type the answer here:

关于博主

  一枚成分复杂的网络IT分子,属于互联网行业分类中的杂牌军。