why the size of all SqlParameters generated by VS2010 are set to 0?
why the size of all SqlParameters generated by VS201开发者_如何转开发0 are set to 0, while when I look in the dataset all the columns are set to different sizes but when I read it from sqldataadapter they are all set to 0. Isn't it going to make some other issues in future? I mean, I have many sqlparameter with NVarChar types that they are generated by VS2010 and the size is 0!!! Any other information in this area will be appreciated. Cheers!
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparameter.size.aspx
"If not explicitly set, the size is inferred from the actual size of the specified parameter value."
My guess is that the size has not been explicitly set; thus it appears as the default for an Int32, which is zero, thus the size will be inferred from the actual size of the value.
(To rephrase: they're not set to 0, they're just not set at all)
精彩评论