Problem with query in Saving Data

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi
Iam using a TableAdapter.Insert method to insert data. The insert method requires certain textboxes to be converted to int.
For example, this.empTableAdaptet.insert(convert.ToInt32(textbox1.Text)).
Here the textbox1.text is a not null field. If the user doesnt enter value for textbox1, the insert
fails. I tried the following method
int32 income;
int32.TryParse(textbox1.Text, out income);
this.empTableAdaptet.insert(income).
this method inserts a 0 when the user doesnt enter value in textbox1.
I want the field to be left blank on insert and not zero being added. Please help. Please note
that it is a not null field
thanks in advance for reply,
karthik v r

View the full article
 
Back
Top