Is there any provable reason why I should always specify the SQL data type for SqlCommand paramenters?
3 Answers
and you will find that sometimes you will get very strange errors when you have not specified the sql type and size
it is safest - and more self-documenting - to always declare the correct sql type and size
1 Comment
Steven A. Lowe
@Grauenwolf: there was a 'wierd SQL error' SO post ~ a week ago caused by not specifying the length of a varchar, but i searched and could not find it. so no, i can't give you a specific example but i can assure you that it does happen. Let me ask you: why would you trust/assume w/out specifying?