Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 28, 2012 12:24 PM by GmGregori
Apr 28, 2012 08:19 AM|LINK
What value u want to save,,
i think it is mobile no ??
if it is mobile no then string is also comfortable for it..
Apr 28, 2012 10:12 AM|LINK
my problem is when client leave textbox empty then how to insert emptytextbox value into integer field column.
Still i m waiting for ur reply..
Apr 28, 2012 10:16 AM|LINK
You can have a convention in this case, e.g. you can insert either 0 or -1 if the entry is empty and thn when you wanna retrive it if it was 0 or -1 it means no entry.
Apr 28, 2012 12:24 PM|LINK
Another possible solution is to employ two distinct insert queries, one with the null value and the other with the input value:
db.Execute("INSERT INTO Nullable(nullint) VALUES(NULL)");
db.Execute("INSERT INTO Nullable(nullint) VALUES(@0)", Convert.ToInt32(Request["val"]));
It isn't good-looking, but it works.