InsertQuery null value to int column

  • Thread starter Thread starter RvGrah
  • Start date Start date
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
 
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.
 
Back
Top