connect MS Access Database

agnerc

New member
Joined
Aug 15, 2006
Messages
1
Programming Experience
Beginner
I have some code that will query my database based on some letters that the user inputs. The code is not error proof so what I would like to do is if the user enters an invalid entry, have a dialog box pop up with some information. Below you will find my code. Any help is apprecated.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Trace.Write(
Me.TextBox1.Text + " " + Me.DataSet11.Tables(0).Rows.Count().ToString())
Dim dataFilter = ""
If (Me.TextBox1.Text.Length > 0) Then
dataFilter = " au_acronym ='" + Me.TextBox1.Text + "'"
End If
Dim row As DataRow
Dim foundRows As DataRow()
foundRows =
Me.DataSet11.Tables(0).Select(dataFilter)
For Each row In foundRows
Me.TextBox2.Text = row(1)
Next row
End Sub
End
Class

Thanks for any help,

Chris
 
Last edited:
Top Bottom