E
Emanuele
Hi People, I want populate one DropDownList with a DataSet.
I've got one problem when I pass the data and text value. My code
(propabily wrong)
pass always the first value of my droplist.
DataSet dst = new DataSet();
dst = myobject.GetDataSet();
droplist.DataSource = dst.Tables[0];
droplist.DataTextField =
dst.Tables[0].Columns["TextValueColumn"].ToString();
droplist.DataValueField =
dst.Tables[0].Columns["DataValueColumn"].ToString();
droplist.DataBind();
***************************
this.Label1.Text = droplist.SelectedItem.Text;
this.Label2.Text = droplist.SelectedItem.Value;
Can you help me?
(sorry for my english, but I'm italian....!)
I've got one problem when I pass the data and text value. My code
(propabily wrong)
pass always the first value of my droplist.
DataSet dst = new DataSet();
dst = myobject.GetDataSet();
droplist.DataSource = dst.Tables[0];
droplist.DataTextField =
dst.Tables[0].Columns["TextValueColumn"].ToString();
droplist.DataValueField =
dst.Tables[0].Columns["DataValueColumn"].ToString();
droplist.DataBind();
***************************
this.Label1.Text = droplist.SelectedItem.Text;
this.Label2.Text = droplist.SelectedItem.Value;
Can you help me?
(sorry for my english, but I'm italian....!)