天天看点

SQL数据类型和C#数据类型间的转换

sql数据类型和c#数据类型间的转换

<language from="sql" to="c#">

   <type from="bigint" to="long" />

   <type from="binary" to="object" />

   <type from="bit" to="bool" />

   <type from="char" to="string" />

   <type from="datetime" to="datetime" />

   <type from="decimal" to="decimal" />

   <type from="float" to="double" />

   <type from="image" to="byte[]" />

   <type from="int" to="int" />

   <type from="money" to="decimal" />

   <type from="nchar" to="string" />

   <type from="ntext" to="string" />

   <type from="numeric" to="decimal" />

   <type from="nvarchar" to="string" />

   <type from="real" to="float" />

   <type from="smalldatetime" to="datetime" />

   <type from="smallint" to="short" />

   <type from="smallmoney" to="decimal" />

   <type from="text" to="string" />

   <type from="timestamp" to="byte[]" />

   <type from="tinyint" to="byte" />

   <type from="uniqueidentifier" to="guid" />

   <type from="varbinary" to="byte[]" />

   <type from="varchar" to="string" />

   <type from="xml" to="string" />

   <type from="sql_variant" to="object" />

</language>

<language from="sql" to="c# system types">

   <type from="bigint" to="system.int64" />

   <type from="binary" to="system.object" />

   <type from="bit" to="system.boolean" />

   <type from="char" to="system.string" />

   <type from="datetime" to="system.datetime" />

   <type from="decimal" to="system.decimal" />

   <type from="float" to="system.double" />

   <type from="image" to="system.byte[]" />

   <type from="int" to="system.int32" />

   <type from="money" to="system.decimal" />

   <type from="nchar" to="system.string" />

   <type from="ntext" to="system.string" />

   <type from="numeric" to="system.decimal" />

   <type from="nvarchar" to="system.string" />

   <type from="real" to="system.single" />

   <type from="smalldatetime" to="system.datetime" />

   <type from="smallint" to="system.int16" />

   <type from="smallmoney" to="system.decimal" />

   <type from="text" to="system.string" />

   <type from="timestamp" to="system.byte[]" />

   <type from="tinyint" to="system.byte" />

   <type from="uniqueidentifier" to="system.guid" />

   <type from="varbinary" to="system.byte[]" />

   <type from="varchar" to="system.string" />

   <type from="xml" to="system.string" />

   <type from="sql_variant" to="system.object" />

<dbtarget from="sql" to="sqlclient">

   <type from="bigint" to="sqldbtype.bigint" />

   <type from="binary" to="sqldbtype.binary" />

   <type from="bit" to="sqldbtype.bit" />

   <type from="char" to="sqldbtype.char" />

   <type from="datetime" to="sqldbtype.datetime" />

   <type from="decimal" to="sqldbtype.decimal" />

   <type from="float" to="sqldbtype.float" />

   <type from="image" to="sqldbtype.image" />

   <type from="int" to="sqldbtype.int" />

   <type from="money" to="sqldbtype.money" />

   <type from="nchar" to="sqldbtype.nchar" />

   <type from="ntext" to="sqldbtype.ntext" />

   <type from="numeric" to="sqldbtype.decimal" />

   <type from="nvarchar" to="sqldbtype.nvarchar" />

   <type from="real" to="sqldbtype.real" />

   <type from="smalldatetime" to="sqldbtype.smalldatetime" />

   <type from="smallint" to="sqldbtype.smallint" />

   <type from="smallmoney" to="sqldbtype.smallmoney" />

   <type from="text" to="sqldbtype.text" />

   <type from="timestamp" to="sqldbtype.timestamp" />

   <type from="tinyint" to="sqldbtype.tinyint" />

   <type from="uniqueidentifier" to="sqldbtype.uniqueidentifier" />

   <type from="varbinary" to="sqldbtype.varbinary" />

   <type from="varchar" to="sqldbtype.varchar" />

   <type from="xml" to="sqldbtype.xml" />

   <type from="sql_variant" to="sqldbtype.variant" />

</dbtarget>

<dbtarget from="sqlce" to="sqlserverce">