string branch="CSE";
string semester = "7";
string cs = ConfigurationManager.AppSettings["keyname"];
cn = new SqlConnection(cs);
cn.Open();
ArrayList myarray = new ArrayList();
string k = "SELECT email FROM table where year='" + ListBox1.Text + "' GROUP BY email";
cm = new SqlCommand(k, cn);
dr = cm.ExecuteReader();
while (dr.Read())
{
myarray.Add(dr["email"]);
}
Label120.Text = myarray.Count.ToString();
}
No comments:
Post a Comment