private DataSet GetTemplatesDs()
{
con.Open();
string sqlToExecute = "select TemplateName,Subject from Template";
SqlDataAdapter da = new SqlDataAdapter(sqlToExecute, con);
DataSet ds = new DataSet();
da.Fill(ds, "Distribution_Mail_Template");
con.Close();
Session["TemplatesDs"] = ds;
return ds;
}
private void PopulateUI()//user defined function
{
Label[] additionalApplicants;
DataSet gettemplatesDs = GetTemplatesDs()
if (gettemplatesDs .Tables.Count > 0 && gettemplatesDs .Tables.Count > 0)
{
for (int i = 0; i < gettemplatesDs .Tables[0].Rows.Count; i++)
{
additionalApplicants = new Label[gettemplatesDs .Tables[0].Rows.Count];
additionalApplicants[i] = new Label();
additionalApplicants[i].ID = gettemplatesDs .Tables[0].Rows[0][""].ToString();
additionalApplicants[i].Text =gettemplatesDs .Tables[0].Rows[0][""].ToString();
this.Page.Controls.Add(additionalApplicants); //Adding controls to webpage
}
}
}
No comments:
Post a Comment