kavithabhaskar 0 Junior Poster

i have 2 comboboxes filled with ram values..both are the same.. i need to choose 0.5 from combobox6 and 2 from combobox7. and when I hit the click button, I want the sql query to get executed.

1. how do i fill the comboboxes with the same values from the RAM field in the table ?

For x As Int32 = 1 To 2

Select Case x

Case 1
query = "SELECT DISTINCT Mfg FROM table1 WHERE Mfg IS NOT NULL ORDER BY Mfg"
TableName = "RAM"
cbo = ComboBox6

Case 2
query = "SELECT DISTINCT MAKE FROM table1 WHERE MAKE IS NOT NULL ORDER BY MAKE"
TableName = "RAM"
cbo = ComboBox7
next

this does not work for me.. i dont know why.. ! please help me with this!!

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 cmd As New OleDbCommand

If (ComboBox6.SelectedItem = 0.5) Then

cmd = New OleDbCommand("select * from table1 where RAM between 0.5 and 2", con)

End If

End Sub

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.