Example #1
0
    }//End Page_Load

    protected void FillDropDownList()
    {
        DataTable table = null;

        try
        {
            table = ba.GetAuthors();
        } catch (Exception ex)
        {
            throw ex;
        }
        //put data from database into dropdown list
        DropDownList1.DataSource     = table;
        DropDownList1.DataTextField  = "AuthorName";
        DropDownList1.DataValueField = "AuthorKey";
        DropDownList1.DataBind();
        DropDownList1.Items.Insert(0, "Choose a Service");
    }