Geeks With Blogs
Developers Friendly

Below are the list of SqlDbType and equivalent CLR type, which will be mostly used while passing parameter to Stored Proc.

 

SqlDbType

CLR Type

SqlDbType.Binary SqlDbType.Image
SqlDbType.Timestamp
SqlDbType.VarBinary

typeof(byte[])

SqlDbType.Char

SqlDbType.NChar

SqlDbType.NText

SqlDbType.NVarChar

SqlDbType.Text

SqlDbType.VarChar

SqlDbType.Xml

typeof(string)

SqlDbType.DateTime

SqlDbType.SmallDateTime

SqlDbType.Date

SqlDbType.Time

SqlDbType.DateTime2

typeof(DateTime?)

SqlDbType.BigInt

typeof(long?)

SqlDbType.Bit

typeof(bool?)

SqlDbType.Decimal

SqlDbType.Money

SqlDbType.SmallMoney

typeof(decimal?)

SqlDbType.Float

typeof(double?)

SqlDbType.Int

typeof(int?)

SqlDbType.Real

typeof(float?)

SqlDbType.UniqueIdentifier

typeof(Guid?)

SqlDbType.SmallInt

typeof(short?)

SqlDbType.TinyInt

typeof(byte?)

SqlDbType.Variant

SqlDbType.Udt

typeof(object)

SqlDbType.Structured

typeof(DataTable)

SqlDbType.DateTimeOffset

typeof(DateTimeOffset?)

 

Thanks!

Posted on Wednesday, September 11, 2013 10:52 PM .NET | Back to top


Comments on this post: SqlDbType to CLR Type

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Manjunath K | Powered by: GeeksWithBlogs.net