using System; using System.Collections; using System.Configuration; using System.Data; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Data.SqlClient; public partial class home : System.Web.UI.Page { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["CMSConnectionString"].ToString()); protected void Page_Load(object sender, EventArgs e) { try { SqlCommand cmd = new SqlCommand("SELECT SUM(TBL_Static.Muslim_No) AS No, City.Name FROM TBL_Static INNER JOIN City ON TBL_Static.City = City.Code GROUP BY City.Name", con); if (con.State == ConnectionState.Closed) con.Open(); SqlDataReader dr = cmd.ExecuteReader(); int i = 1; string taha = ""; taha += ""; lblerror.Text = taha; } catch (Exception ex) { throw; } } }