My code is:
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click Try Dim OleDbCommand1 As New OleDb.OleDbCommand("SELECT * FROM Table1 WHERE Field = '" & TextBox1.Text & "' ", OleDbConnection) Dim OleDbDataAdapter1 As New OleDb.OleDbDataAdapter(OleDbCommand1) OleDbDataAdapter1.Fill(DataSet1) Catch oledbex As OleDb.OleDbException MessageBox.Show(oledbex.Message) End Try End Sub
A datagrid is being used to show the information. I want the grid to show the fields where the text in the textbox matches the text in a database field. So far when i click the button nothing happens. What am i doing wrong. please help me.




Reply With Quote