HOW TO VALIDATE DATA IN C#

Barbara Jones

Total Post:19

Points:95
Posted by  Barbara Jones
C# 
C#
 456  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 Mar-28-2018 10:42:02 PM

Answer

NEWSLETTER

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