Get Selected item from Combobox [RESOLVED!!]
hi all !!!
ok..i'm working on a vb.net project..what i need to do is that populate a combo-box from a table with the primary key, on selecting the item from the combo-box, the text box below fills in with the description of the selected primary key and finally on clicking on the button, the entire form fills in with the details corressponding to the key selected.
i have populetd the combo-box, got the key on selceting. now begins my problem...i cant get the description on selecting.
here's what i'm doing.
Code:
Dim strQuery As String
strQuery = "SELECT NAME FROM MASTER WHERE SR_NO='" & cmbPicCode.SelectedItem & "'"
Dim myAdapter1 As New OleDbDataAdapter(strQuery, dbConn)
myAdapter1.Fill(MyDataSet1, "Picture")
txtName.Text = MyDataSet1.Tables("Picture").Rows(0).Item("NAME")
i know the way of filling the text box is wrong..because no matter what SR_NO i select, i get the Name in the first row (coz of the rows)
Plz guys..this is urgent
thnx n take care