when i check one or 2 or 3 or all 4 chechboxes..i want a corresponding SQL query to get executed.
Please help me rectify my code..
thanks
kavitha.
Dim con As OleDbConnection = 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 (CheckBox1.Checked = True) And (CheckBox1.Checked = True) And (CheckBox3.Checked = True) And (CheckBox4.Checked = True) Then
cmd1 = New OleDbCommand("select * from table1 where MECH='X' and MACH='X' AND UGSTRUCTURES='X' AND UGPCBXCHANGE='X'")
Dim da As OleDbDataAdapter = New OleDbDataAdapter(cmd1)
Try
Dim ds As DataSet = New DataSet()
ds.Tables.Add("table1")
da.Fill(ds, "table1")
DataGridView1.DataSource = ds.Tables("table1").DefaultView
Finally
con.Close()
cmd1 = Nothing
da.Dispose()
con.Dispose()
End Try
End If