|
-
Feb 28th, 2004, 01:15 AM
#1
Thread Starter
Member
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
Last edited by amNewatVB; Feb 28th, 2004 at 01:42 AM.
-
Feb 28th, 2004, 01:41 AM
#2
Thread Starter
Member
well have found what i was doing wrong
Code:
myDataSet1.Tables.Clear
this line clears the previous values and now the new value come.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|