SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings[0].ConnectionString);
SqlCommand cmd = new SqlCommand("select * from Student1", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
drpdownlist.DataTextField = ds.Tables[0].Columns["FullName"].ToString();
drpdownlist.DataValueField = ds.Tables[0].Columns["Id"].ToString();
drpdownlist.DataSource = ds.Tables[0];
drpdownlist.DataBind();
Its giving problem for the first line.
Please help.