Hi,
I have a problem with my combo box.
I have 4 combo boxes which are bound to database.
The problem is if I choose one of the list item in 1st combo box then other second , third and forth combo boxex will display the same item.
This is causing me a problem because I am creating a form to calculate a priced item.
First combo box must have different item list from second, third and forth.
For your info too, all these combo boxes are connected to 1 table with column item name.
Please advise or show me how I can make it that if I choose one item list in first combo box then second , third and forth combo box can display with different list items.
I need to solve this issue.
Here is my coding, Please correct my coding if it have a mistake
Private Sub ItemNameComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ItemNameComboBox.SelectedIndexChanged
connection.ConnectionString = "Data Source=Danawa;Initial Catalog=Store;Integrated Security=True "
connection.Open()
cmd = New SqlCommand("SELECT * FROM ItemIn WHERE ItemName = '" & Me.ItemNameComboBox.Text & "' ", connection)
Dr = cmd.ExecuteReader()
If Dr.Read = False Then
MsgBox("Item Name Is Not Found!!", MsgBoxStyle.Exclamation)
Else
Me.price.Text = Dr("ItemPrice").ToString
End If
Dr.Close()
connection.Close()