select colu,colu from table
string k1 = "select Department_Name, Department_id from Department_mast";
cm = new SqlCommand(k1, cn);
dr = cm.ExecuteReader();
ddldeptname.DataSource = dr;
ddldeptname.DataTextField = "Department_Name";
ddldeptname.DataValueField = "Department_id";
ddldeptname.DataBind();
ddldeptname.Items.Insert(0, "select");
dr.Close();
Label1.Text = DropDownList1.SelectedItem.Value;
datatexfield
datavaluefield
dl.selecteditem.tex
d1.selecteditem.value
No comments:
Post a Comment