string ss = @"Data Source=VMB-PC\SQLEXPRESS;Initial Catalog=website;Integrated Security=True";
s = new SqlConnection(ss);
s.Open();
SqlCommand cmd = new SqlCommand("select *from departments",s);
SqlDataReader d = cmd.ExecuteReader();
for (int i = 0; d.Read(); i++)
{
DropDownList1.Items.Insert(i, d.GetString(0));
}
s = new SqlConnection(ss);
s.Open();
SqlCommand cmd = new SqlCommand("select *from departments",s);
SqlDataReader d = cmd.ExecuteReader();
for (int i = 0; d.Read(); i++)
{
DropDownList1.Items.Insert(i, d.GetString(0));
}
No comments:
Post a Comment