protected void Page_Load(object sender, EventArgs e)
{
SqlConnection myconnection = new SqlConnection("server=(local);database=Northwind;uid=sa;pwd=");
string sql = "select categoryName from categories";
SqlDataAdapter sda = new SqlDataAdapter(sql,myconnection);
DataSet ds = new DataSet();
sda.Fill(ds,"a");
DropDownList1.DataSource = ds.Tables["a"];
DropDownList1.DataTextField = "categoryName";
DropDownList1.DataBind();
{
SqlConnection myconnection = new SqlConnection("server=(local);database=Northwind;uid=sa;pwd=");
string sql = "select categoryName from categories";
SqlDataAdapter sda = new SqlDataAdapter(sql,myconnection);
DataSet ds = new DataSet();
sda.Fill(ds,"a");
DropDownList1.DataSource = ds.Tables["a"];
DropDownList1.DataTextField = "categoryName";
DropDownList1.DataBind();