using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; 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 DomHost_HostimgRenewal : System.Web.UI.Page { SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString); FillDD objFillDD = new FillDD(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { fill_DomainList(); fill_DGDetails(); } lblerr.Text = ""; } void fill_DomainList() { objFillDD.Get_DDList(ref DDDomainList, "Id", "DomainName", "tbl_DomainMaster", ref lblerr); } protected void DDDomainList_SelectedIndexChanged(object sender, EventArgs e) { lblerr.Text = " and tbl_DomainMaster.DomainName= '" + DDDomainList.SelectedItem.Text + "'"; fill_DGDetails(); } void fill_DGDetails() { try { string view = "SELECT tbl_HostingDetails.Id, tbl_HostingDetails.DomainName AS DomId, Convert(varchar(15),tbl_HostingDetails.HRegDate,101) as HRegDate, tbl_HostingDetails.HPeriod, Convert(varchar(15),tbl_HostingDetails.HExpDate,101) as HExpDate, " + " tbl_HostingDetails.HRegisterBy, tbl_HostingDetails.HFtpUrl, tbl_HostingDetails.HUid, tbl_HostingDetails.HPass, tbl_HostingDetails.HSpace, " + " tbl_HostingDetails.HReNew, tbl_HostingDetails.EntryBy, Convert(varchar(15),tbl_HostingDetails.EntryDate,101) as EntryDate, tbl_HostingDetails.ServerNm, tbl_DomainMaster.Id AS Dom, " + " tbl_DomainMaster.ClientName, tbl_DomainMaster.DomainName , tbl_ClientMaster.Id AS cliId, tbl_ClientMaster.ClientName" + " FROM tbl_ClientMaster INNER JOIN" + " tbl_DomainMaster ON tbl_ClientMaster.Id = tbl_DomainMaster.ClientName INNER JOIN" + " tbl_HostingDetails ON tbl_DomainMaster.Id = tbl_HostingDetails.DomainName" + " WHERE tbl_DomainMaster.Hosting='Yes' " + lblerr.Text; SqlDataAdapter adp1 = new SqlDataAdapter(view, con); DataSet ds1 = new DataSet(); adp1.Fill(ds1, "DH1"); DGDetails.DataSource = ds1.Tables["DH1"]; DGDetails.DataBind(); } catch (Exception exp) { lblerr.Text = ("DG Alert! : " + exp.Message); } } protected void OnPageChange(object source, DataGridPageChangedEventArgs e) { try { lblerr.Text = ""; DGDetails.CurrentPageIndex = e.NewPageIndex; fill_DGDetails(); } catch (Exception exp) { lblerr.Text = ("DG Alert! : " + exp.Message); } } }