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!
Loading
naura paxPosted Sep 29, 2009, 1:09 AM
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.