extremely slow lookup for a query (see last post)
i am new to vb.net and am working on my first form that interacts with an access database. I dont seem to be able to figure out the syntax for creating a query against the dataset in which the WHERE clause is based on the user texbox input in the form. here is what I have - any help will be greatly appreciated!
i am new to vb.net and am working on my first form that interacts with an access database. I dont seem to be able to figure out the syntax for creating a query against the dataset in which the WHERE clause is based on the user texbox input in the form. here is what I have - any help will be greatly appreciated!
Code:
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Dim commandString As String = New String("Select First_Name, Last_Name from Demographics where First_Name = Me.TextBox1.Text")
Me.OleDbDataAdapter1 = New System.Data.OleDb.OleDbDataAdapter(commandString, OleDbConnection2)
Me.OleDbDataAdapter1.Fill(DataSet1, "Demographics")
Me.DataGrid1.DataSource = DataSet1.Tables("Demographics")
Me.DataGrid1.Update()
Application.DoEvents()
End Sub
Last edited by a moderator: