protected void BindCustomerNameddl()
{
con.Open();
SqlCommand cmd = new SqlCommand("Select cid,name FROM memberLogin", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
ddlCustomername.DataSource = ds;
ddlCustomername.DataTextField = "name";
ddlCustomername.DataValueField = "cid";
ddlCustomername.DataBind();
ddlCustomername.Items.Insert(0, new ListItem("--Select--", "0"));
con.Close();
}
{
con.Open();
SqlCommand cmd = new SqlCommand("Select cid,name FROM memberLogin", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
ddlCustomername.DataSource = ds;
ddlCustomername.DataTextField = "name";
ddlCustomername.DataValueField = "cid";
ddlCustomername.DataBind();
ddlCustomername.Items.Insert(0, new ListItem("--Select--", "0"));
con.Close();
}
No comments:
Post a Comment