That's better. It so much easier to help someone who is telling the
purpose of the question instead of just asking for how to do it the way
he/she thinks that it is done. :)
The best validation for numeric values and dates is to actually try to
convert them. Use DateTime.TryParse and Int32.TryParse methods for
instance. If you use a parameterized query (which you really should),
you would want them converted anyway.
To validate string data you can use RegEx. To verify that a string only
contains alphabetic characters you use RegEx.IsMatch(theString,
"^[A-Za-z]$").
yo********@gmail.com wrote:
Hi,
I need to validate data from textboxes before I add them to the sql
query.
I think adding a reference to VisualBasic is too comlicated, not that
it is hard but it just doesn't seem right.
Also is there a function to validate a date?
Thanks,
Yossi.