required field validation in c#.net

Posted by Madhuri123 under C# on 3/23/2011 | Points: 10 | Views : 11215 | Status : [Member] | Replies : 2
Hi,

This is madhuri, Iam inserting values into the db(sql server) from windows apllications.Before Submitting these values into db i must araise the required validations in my form


Can u please help me




Responses

Posted by: Prabhakar on: 3/23/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi madhuri

Check this Link

http://www.dotnetfunda.com/tutorials/controls/requiredfieldvalidator.aspx

Best Regard's
Prabhakar

Madhuri123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chvrsri on: 3/23/2011 [Member] [Moderator] [MVP] Silver | Points: 25

Up
0
Down
Hi Madhuri,

You didn't mentioned the control which you are using . Any how follow the link which was given below which explains the required field validations for all types of controls in WINDOWS APPLICATIONS.

This is default validation control.

http://www.codeproject.com/KB/validation/validationprovider.aspx

or else you can do it in a simple way but this is not proffered since it is server side validation.

if(textbox1.text == "" && textbox2.text == "")

{
messagebox.show("Fill all text boxes");

}
else
{
Insert Values into your D/B
}


Hope this helps !!!

Thanks,
Radha Srikanth

Madhuri123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response