there is another problem that i am facing..i got 2 comboboxes filled with values from MS Access and they have values like 1.00,2.00,2.98,3.00,3.25 and 8.00
I want to be able to choose 2 values i.e. one value from each combo box and when I hit click I should get queries which have RAM values equal to and between the 2 chosen values from the combobox..
this query does not get executed and I get the error of datatype mismatch..i have been breaking my head to solve this but all in vain.. can u help me with this one also pls!!
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim con As OleDbConnection = New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=C:\Documents and Settings\bashkark\Desktop\Copy of USERS.mdb")
Dim cmd1 As New OleDbCommand
cmd1 = New OleDbCommand("select * from table1 where RAM between '" CDec(ComboBox6.SelectedItem) "' and '" CDec(ComboBox7.SelectedItem) "'", con)
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