Click here to Skip to main content
14,979,508 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i want to bind the data in dropdownlist from sql server
Posted
Comments
Sandeep Mewara 7-Jun-11 11:40am
   
And the issue is?
   
Not a question.
--SA

So do that! (If you have a problem, please describe it so we can actually help you)
Look here[^]here for starters
   
Try

private void dropdownlistbind()
    {
       
        SqlCommand cmd = new SqlCommand("Your Command using appropriate clause","Your Connection");
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataSet ds = new DataSet();
        da.Fill(ds);
        DropDownList1.DataSource = ds;
        // FieldName of Table in DataBase
        DropDownList1.DataValueField = "FieldName";
        DropDownList1.DataBind();   
      }	
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900