Hello;
I need to validate when the users pulses TAB/ENTER for leaving a textbox, the user writes a "Code number" so i need to verify against a DataBase if it exists or not.
The database i use is VistaDB
http://www.vistadb.net.
By now wath i've done is this, but the "Catch", it launches an error message "Mus Specify a DataSource Prior to Open" when i write a Code Number in the Textbox and press TAB:
Private Sub TextBox1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
Dim valor As String
valor = TextBox1.Text
Dim cn As New VistaDB.VistaDBConnection
Dim cm As New VistaDB.VistaDBCommand
Dim dr As VistaDB.VistaDBDataReader
cn.ConnectionString = "data source=Kardex;initial catalog=Proveedores;integrated security=SSPI;"
Try
cn.Open()
Catch ex As Exception
MsgBox("Error :" + ex.Message)
End Try
End Sub
can you help with this?
In VFP is easy but in VB.NET i can get it.