Hi,
i'm working with c# and MySQL, and i need to validate some textboxes to ensure valid data is inserted to the database.
i did some coding and it works but i need the easiest and the right way to do that and if there is a TOOLBOX for validation that will be great.
not just for null value, i need to make sure only numbers are inserted.
thanks in advance for any help
i'm working with c# and MySQL, and i need to validate some textboxes to ensure valid data is inserted to the database.
i did some coding and it works but i need the easiest and the right way to do that and if there is a TOOLBOX for validation that will be great.
Code:
private void textBox1_Validating(object sender, CancelEventArgs e)
{
if (String.IsNullOrEmpty(textBox1.Text))
e.Cancel = true;
}
thanks in advance for any help
Comment