Click here to Skip to main content
15,308,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good Evening to all in my project i am using rad grid how can i validate the null values in update command and insert command.Please help me any one.

Thanks in advance
E.F. Nijboer 26-Oct-12 10:13am
Your question isn't very clear. Have you checked out DBNull?
meganathanm 26-Oct-12 10:24am
Thank you for your reply i am not check the db value. First i am insert the first record at that time i am failed to fill the some required value in text box and click on insert how can i validate and give the alert.I get the text box value from code behind as follows
string Booksubcategoryname = (insertedItem["Booksubcategoryname"].Controls[0] as TextBox).Text;
Sergey Alexandrovich Kryukov 26-Oct-12 12:58pm
Are you working with System.DBNull? If so what's the problem?
Sandeep Mewara 28-Oct-12 4:04am
Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.

1 solution

Use the static method "bool System.String.IsNullOrEmpty(string value)", something like this:
string text = SomeControl.Text;
if (String.IsNullOrEmpty(text))
    // Warn user or whatever...
    // use string...
meganathanm 29-Jan-13 10:16am
Thank you for your reply Mr.Frederico Barbosa Your code is working fine for me but i need the client side validation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900