Asp.Net Dropdown Binding

String q = "select * from platform";
cmd = new SqlCommand(q, con);
cmd.ExecuteNonQuery();
SqlDataAdapter adt = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
adt.Fill(ds);
dt = ds.Tables[0];
dropdown1.DataSource = dt;
dropdown1.DataTextField = "plat_name";
dropdown1.DataValueField = "plat_id";
dropdown1.DataBind();

Comments