Home > DeveloperSection > Interviews > How to validate data in C#

Posted on    September-16-2016 5:15 AM

 C# C# 
 1 Answer(s)
  74  View(s)
Rate this:

Barbara Jones

Total Post:17

Posted on    September-16-2016 5:15 AM

Data validation in C# 


If there is a need to add validation like data can't be empty then following codes can be use after the click button


   if (textBox1.Text == string.Empty)


                MessageBox.Show("Please enter the Name");




Output :


Modified On Sep-17-2016 12:45:10 AM

Don't want to miss updates? Please click the below button!

Follow MindStick