博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

C#——db的数据类型对应

Posted on 2013-04-11 14:50  fochan  阅读(393)  评论(0编辑  收藏  举报

C#——db的数据类型对应

AnsiString:VarChar

Binary:VarBinary

Byte:TinyInt

Boolean:Bit

Currency:Money

Date:DateTime

DateTime:DateTime

Decimal:Decimal

Double:Float

Guid:UniqueIdentifier

Int16:SmallInt

Int32:Int

Int64:BigInt

Object:Variant

Single:Real

String:NVarChar

Time:DateTime

AnsiStringFixedLength:Char

StringFixedLength:NChar

Xml:Xml

DateTime2:DateTime2

DateTimeOffset:DateTimeOffset

 

类型对应上,在数据库端的性能会得到一定的改善,不要总是 string 来对应。