HOW TO VALIDATE DATA IN C#

Barbara Jones

Total Post:19

Points:95
Posted by  Barbara Jones
C# 
C#
 366  View(s)
Ratings:
Rate this:
  1. Barbara Jones

    Post:19

    Points:95
    How to validate data in C#

    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");

                    return;

                }

     

    Output :


     

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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!