Sunday, September 16, 2018

Array List Counter in asp.net c#

        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

GRIDVIEW ON ROW DATA BOUND EVENT

 Database Create  Student : roll , name , city , cost  Fix 6 Value  in Database Record  ====================================================...