The following table lists Microsoft SQL Server data types, their equivalents in the common language runtime (CLR) for SQL Server in the System.Data.SqlTypes namespace, and their native CLR equivalents in the Microsoft .NET Framework.
SQL Server data type | CLR data type (SQL Server) | CLR data type (.NET Framework) |
varbinary | SqlBytes, SqlBinary | Byte[] |
binary | SqlBytes, SqlBinary | Byte[] |
varbinary(1), binary(1) | SqlBytes, SqlBinary | byte, Byte[] |
image | None | None |
varchar | None | None |
char | None | None |
nvarchar(1), nchar(1) | SqlChars, SqlString | Char, String, Char[] |
nvarchar | SqlChars, SqlString
SQLChars is a better match for data transfer and access, and SQLString is a better match for performing String operations. | String, Char[] |
nchar | SqlChars, SqlString | String, Char[] |
text | None | None |
ntext | None | None |
uniqueidentifier | SqlGuid | Guid |
rowversion | None | Byte[] |
bit | SqlBoolean | Boolean |
tinyint | SqlByte | Byte |
smallint | SqlInt16 | Int16 |
int | SqlInt32 | Int32 |
bigint | SqlInt64 | Int64 |
smallmoney | SqlMoney | Decimal |
money | SqlMoney | Decimal |
numeric | SqlDecimal | Decimal |
decimal | SqlDecimal | Decimal |
real | SqlSingle | Single |
float | SqlDouble | Double |
smalldatetime | SqlDateTime | DateTime |
datetime | SqlDateTime | DateTime |
sql_variant | None | Object |
User-defined type(UDT) | None | Same class that is bound to the user-defined type in the same assembly or a dependent assembly. |
table | None | None |
cursor | None | None |
timestamp | None | None |
xml | SqlXml | None |
3 comments:
Thanks for all the information,it was very helpful and i really like that you are providing information on .net training ,being enrolled in .net freshers training with projects live training http://www.wiziq.com/course/57-fresher-training-projects i was looking for such .net fresher training to assist me and your information helped me a lot.Really like that you are providing such information . Than
The grid enables work with arrays of strings or any other objects.This method is applicable only to very simple applications.The grid doesn’t set any limitations of data types,however working with untyped data in a large application often causes a lot of errors,makes the code much more complicated and indicates improper application design.more detail you can read tutorial on dapfor. com
Nice post very helpful
dbakings
Post a Comment
Share your thoughts here...