SQL Server类型与dotnet类型的对应关系

.NET Framework Data Provider for SQL Server

SQL Server type .NET Framework type .NET Framework typed accessor SqlType typed accessor
bigint Int64 GetInt64() GetSqlInt64()
binary Byte[] GetBytes() GetSqlBinary()
bit Boolean GetBoolean() GetSqlBit()
char String

Char[]

GetString()

GetChars()

GetSqlString()
datetime DateTime GetDateTime() GetSqlDateTime()
decimal Decimal GetDecimal() GetSqlDecimal()
float Double GetDouble() GetSqlDouble()
image Byte[] GetBytes() GetSqlBinary()
int Int32 GetInt32() GetSqlInt32()
money Decimal GetDecimal() GetSqlMoney()
nchar String

Char[]

GetString()

GetChars()

GetSqlString()
ntext String

Char[]

GetString()

GetChars()

GetSqlString()
numeric Decimal GetDecimal() GetSqlDecimal()
nvarchar String

Char[]

GetString()

GetChars()

GetSqlString()
real Single GetFloat() GetSqlSingle()
smalldatetime DateTime GetDateTime() GetSqlDateTime()
smallint Int16 GetInt16() GetSqlInt16()
smallmoney Decimal GetDecimal() GetSqlDecimal()
sql_variant Object * GetValue() * GetSqlValue() *
text String

Char[]

GetString()

GetChars()

GetSqlString()
timestamp Byte[] GetBytes() GetSqlBinary()
tinyint Byte GetByte() GetSqlByte()
uniqueidentifier Guid GetGuid() GetSqlGuid()
varbinary Byte[] GetBytes() GetSqlBinary()
varchar String

Char[]

GetString()

GetChars()

GetSqlString()

如想知道与其他数据库的对应关系。看MSDN:http://msdn2.microsoft.com/en-us/library/4e5xt97a(vs.71).aspx
posted @ 2007-04-19 09:12  芽芽陆  阅读(405)  评论(0编辑  收藏  举报