Can you explain me the difference between Type and DbType in a parameter of a datasource?
What is the best pratice of assigning these two properties?
Can you explain me the difference between Type and DbType in a parameter of
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Type Represents type declarations: class types, interface types, array types, value types, enumeration types, type parameters, generic type definitions, and open or closed constructed generic types.
like
Int32, String, complex typesit is for front-end referene
ref: http://msdn.microsoft.com/en-us/library/system.type.aspx
While
DBType
Specifies SQL Server-specific data type of a field, property, for use in a SqlParameter.
ref: http://msdn.microsoft.com/en-us/library/system.data.sqldbtype.asp
So this means: you must use
Typewhen referencing from DB to C#/VBand
DBTypewhen referencing/Passing values to DB From C#/VBHope this helps…