码迷,mamicode.com
首页 > 数据库 > 详细

DAL与数据库类型的对应关系

时间:2015-07-14 19:39:26      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:

MSSQL Server类型 DbType类型 C#类型   MySql类型 DbType类型 C#类型
bit Boolean bool   bit(1) Boolean bool
tinyint Byte byte   bit UInt64 ulong
smallint Int16 short   tinyint(1) Boolean bool
int Int32 int   tinyint Byte byte
bigint Int64 long   smallint Short short
real Single float   int Int32 int
float Double double   bigint Int64 long
money Decimal decimal   decimal Currency decimal
numeric Decimal decimal   double Double double
decimal Currency decimal   float Single float
smallmoney Currency decimal   char(1) AnsiStringFixedLength char
date Date DateTime   char AnsiStringFixedLength string
time Time TimeSpan   varchar AnsiString string
datetime DateTime DateTime   date DateTime DateTime
smalldatetime DateTime DateTime   datetime DateTime DateTime
datetime2 DateTime DateTime   time Time TimeSpan
datetimeoffset DateTimeOffset DateTime   timestamp DateTime DateTime
timestamp Binary byte[]   year Int16 short
char(1) AnsiStringFixedLength char   binary Binary byte[]
char AnsiStringFixedLength string   text String string
varchar AnsiString string        
nchar StringFixedLength char        
nvarchar String string        
text String string        
ntext String string        
image Binary byte[]        
binary Binary byte[]        
uniqueidentifier Guid Guid        
image Binary byte[]        
sql_variant Object object        
xml Xml string        

DAL与数据库类型的对应关系

标签:

原文地址:http://www.cnblogs.com/streetpasser/p/4646043.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!