Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how can i save a null value from web control to an integer field in the data base

Reply
Thread Tools

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

 
 
casper_992@hotmail.com
Guest
Posts: n/a
 
      09-26-2005
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.

 
Reply With Quote
 
 
 
 
Rob Schieber
Guest
Posts: n/a
 
      09-26-2005
wrote:
> 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;


--
Rob Schieber
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2FsbCBKYXZhc2NyaXAgZnJvbSB0aGUgc2VydmVyIHNpZGU=?=
Guest
Posts: n/a
 
      09-26-2005
Did you try "System.DBNull.Value"?

Ryan

"" wrote:

> 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.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript validation for a not required field, field is onlyrequired if another field has a value jr Javascript 3 07-08-2010 10:33 AM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
comparing field data from previous field in loop with null values abbylee26@hotmail.com ASP General 6 02-15-2006 01:59 PM
Save Null Value to SQL Table in DateTime Field?? crjunk ASP .Net 2 02-02-2004 08:56 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57