how can i save a null value from web control to an integer field in the data base

C

casper_992

i've a data base that has an integer field ,and i wanna save null value
to that field, but it gives me an error "Input string was not in a
correct format. " when i click a button to save.
 
R

Rob Schieber

i've a data base that has an integer field ,and i wanna save null value
to that field, but it gives me an error "Input string was not in a
correct format. " when i click a button to save.

try passing null instead of an empty string.

if(string == string.Empty())
parm.value = null;
 

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

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top