InsertQuery null value to int column

R

RvGrah

I have a TabelAdapter that has an int column that allows null (no
lectures please, I have my reasons). When I use intellisense to fill in
the parameters in the InserQuery method, it shows the needed value as
?int, with the question mark. But if the combo box that the value is
coming from has a null value the query throws an exception. How can I
configure my query to pass the null value when necessary?

Thanks, Bob
 
N

Nicholas Paldino [.NET/C# MVP]

Bob,

Are you sure that you are passing a null value to the adapter? The list
box probably doesn't have a null value in it, but rather, an empty string,
and that is being passed, which causes the exception.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top