Home > Forum > ASP.NET > no data show in output page in asp.net

no data show in output page in asp.net

by celv   on Nov 25, 2014   Category: ASP.NET  |  Views: 856    |  Points: 5   |  Bronze 
  Reply
private void AddDynamicLabels()
{
string ConString = ConfigurationManager.AppSettings["s"].ToString();
SqlConnection con = new SqlConnection(ConString);
string CmdString = "Select sectionname,totalsales from sectionsales";
SqlCommand cmd = new SqlCommand(CmdString, con);
con.Open();
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
Label lbl = new Label();
Label lbls = new Label();
lbl.Text = reader["sectionname"].ToString();
lbls.Text = reader["totalsales"].ToString();
lbl.BackColor = System.Drawing.Color.Red;
lbls.BackColor = System.Drawing.Color.Red;
Controls.Add(new Literal { Text = "<br/>" });
}
}

if i put breakpoint it show the data. but in output page it never show the data

no data show in output page in asp.net

Bookmark and Share:
 
  User Reply  | Ask a question  |   Reply 


  No response found, be the first to answer this question.


Recent Post

Latest Posts