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 homeShow : 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 order by No Desc", con); if (con.State == ConnectionState.Closed) con.Open(); SqlDataReader dr = cmd.ExecuteReader(); int i = 1; string taha = ""; taha += "
"; while (dr.Read()) { taha += ""; i = i + 1; } //taha = taha.Substring(0, taha.Length - 1); taha += "
مالمدينةعدد المسلمين
" + i + "" + dr[1].ToString() + "" + dr[0].ToString() + "
"; lblerror.Text = taha; } catch (Exception ex) { throw; } } }