Welcome to WindowsClient.net | My Blog | Sign in | Join

Windows Client Videos

SmartClient - Data Validation

This video covers how and when to validate during data entry with examples for individual controls and interdependent controls and includes Regular Expressions techniques.

Author: Pat Tormey

Comments

Terminator92115 said:

Thanks Pat for this great intro into Windows Forms Data Validation. I found it easy to follow and understant. I have some feed back for you. After watching this video I tried to implement Data Validation and got stuck on how detect if any of the Form Controld had invalid data. After a little research I found that you need to set the Cancel Property of the e Argument to True. Then Me.ValidateChildren() will return false and you can add logic to prevent the user going any further until all data validation passes. Thanks again :-)

# April 22, 2008 10:13 PM

jytylr said:

This was helpful for me as well. Thank you.

# November 14, 2008 7:19 PM

Pat Tormey said:

Thanks Terminator!

Pat

# November 18, 2008 6:48 AM

marcos2009 said:

hi i'll really need hel with this.... i'm working in a vb.net project and and i'm programming tha validation with the error provider.... but when i put Me.ValidateChildren() in a botton it doesn't work as i want

this is my cod:

If Me.ValidateChildren = True Then

           MessageBox.Show("Not valid information ")

       Else

           Dim conexion As New SqlConnection("Data Source=SERVER\SQLEXPRESS; Initial Catalog=Promotions; Integrated Security=SSPI")

           Dim sql As New SqlCommand("insert into cargo values('" & Me.TextBox3.Text & "', '" & Me.TextBox4.Text & "')", conexion)

           conexion.Open()

           sql.ExecuteNonQuery()

           conexion.Close()

           fill_cargo()

           Me.TextBox3.Enabled = False

           Me.TextBox4.Enabled = False

       End If

and doesn't make the conection and information is right

I'm sorry about my english but i'm learning english too

# January 6, 2009 8:42 PM