when I hit click i get a blank table in my datagridview with no values in it! why is that ?
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim con As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=C:\Documents and Settings\bashkark\Desktop\Copy of USERS.mdb")
Dim cmd1 As New OleDbCommand
con.Open()
If (RadioButton1.Checked = True) Then
cmd1 = New OleDbCommand("select * from table1 where GRAPHICSCARD='NVIDIA *'", con)
End If
If (RadioButton2.Checked = True) Then
cmd1 = New OleDbCommand("select * from table1 where GRAPHICSCARD='3D*'", con)
End If
Dim da As OleDbDataAdapter = New OleDbDataAdapter(cmd1)
Try
Dim ds As DataSet = New DataSet
da.Fill(ds, "table1")
DataGridView1.DataSource = ds.Tables("table1").DefaultView
Finally
con.Close()
cmd1 = Nothing
da.Dispose()
con.Dispose()
End Try
End Sub