0
SqlDataAdapter da3 = new SqlDataAdapter(com2);
        DataSet ds2 = new DataSet();
        da3.Fill(ds2);  // fill dataset  
        ddlYear.DataTextField = ds2.Tables[0].Columns["yearofcd"].ToString(); // text field name of table dispalyed in dropdown       
        ddlYear.DataSource = ds2.Tables[0];      //assigning datasource to the dropdownlist  
        ddlYear.DataBind();  //binding dropdownlist
        ddlYear.SelectedIndex = 1;
<asp:DropDownList ID="ddlYear" runat="server"></asp:DropDownList>
                                                        <div>
                                                            <select id="checkboxes" multiple="multiple">
                                                                <option></option>
                                                            </select>
                                                        </div>

here I'm Binding data in ddlYear how to use it in the option of select tag?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.