public void LoadGird() { string MobileNo = Convert.ToString(Request.QueryString["Mobileno"]); try { if (MobileNo == "" || MobileNo == null) { Response.Redirect("~/udise/Home.aspx"); } else { string Sql = "Select Top(60) usrFirstName,usrLastName,pk, Message,mobile,shortcode,data,SendDate,FlagStatus from Come2mycity.test inner join UserMaster on " + "Come2mycity.test.mobile= UserMaster.usrMobileNo" + " where mobile='" + MobileNo + "' order by pk desc"; DataSet ds = cc.ExecuteDataset(Sql); gvItem.DataSource = ds.Tables[0]; gvItem.DataBind(); foreach (GridViewRow row in gvItem.Rows) { string Data = row.Cells[6].Text.ToString(); if (Data == "0") { row.Cells[6].Text = "Correct"; } else if (Data == "1") { row.Cells[6].Text = "Incorrect"; } else if (Data == "2") { row.Cells[6].Text = "Updated"; } else if (Data == "3") { row.Cells[6].Text = "Pending"; } } foreach (GridViewRow row in gvItem.Rows) { string Data = row.Cells[5].Text.ToString(); Data = cc.DTGet_LocalEvent(Data); row.Cells[5].Text = Data; } } } catch (Exception ex) { } }
//----------------------------------------------------------Load Data bind to GridView--------------------------------------------------------------- public void LoadItem() { string Sql = "Select SchoolCode,EntryDate,RegBoys,RegGirls,Present_B,Present_G from UDISE_AbstractSchoolPresenty where EntryDate='" + DateFormat + "'"; DataSet ds2 = cc.ExecuteDataset(Sql); gvItem.DataSource = ds2.Tables[0]; gvItem.DataBind(); foreach (GridViewRow row in gvItem.Rows) { string Data = row.Cells[2].Text.ToString(); Data = cc.DTGet_LocalEvent(Data); row.Cells[2].Text = Data; } }