Hello,
I have a combobox that gets values from a stored procedure (CODE,DESCRIPTION) as following:
combo1.ValueMember=CODE
combo1.DisplayMember=DESCRIPTION
Is it possible to have a stored procedure (CODE,DESCRIPTION,EXPR1,EXPR2) as following:
combo1.ValueMember=CODE
combo1.DisplayMember=DESCRIPTION
on combobox change:
textbox1.Text=EXPR1
textbox2.Text=EXPR2
Is it possible?
Thank you in advance!
Combobox that after selection saves values in textboxes.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

naura paxRank #2,843 · 502 reputationPosted Sep 28, 2009, 9:09 PM EDT
Yes it is possible to do that. When you fill the combobox with a dataset (or datatable) say ds then you can specify four fields in your select query in stored procedure.
In the selectedindexchanged or selectedvaluechanged event of combo box
you can retrieve those values as following
DataRow[] arr=ds.Select("CODE='" + cmb.SelectedValue.ToString() + "'")
and retrieve values as arr[0]["Expr1"].
Tell me if you could grasp it.