I’m using ADO.NET to communicate some db, and searching for a way to avoid boxing when setting the DbParameter.Value property to value-type.
Is there a way to avoid boxing in DbParameter.Value?
Thanks.
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.
I don’t think so. If you examine the Value property of the SqlParameter class in Reflector, you will see that the internal field where the value is stored is also of type object. There is no place for it to store ints or floats or whatever any other way.