I am using ASP.net 2.0 with c#.I fetch the data from database using sqldatareader.when i fetch data for one label control it works fine. what i need is, in my web form i have 6 lables named as lbl1,lbl2,lbl3,lbl4......
so i would like to incremement the lable id ,
i did as i given below,
while (dr.Read())
{
for (int i = 1; i <= 2; i++)
{ lbl1.Text = dr["name"].ToString();
lbl2.Text = dr["design"].ToString();
Response.Write("<p>");
--------------------------
Label lbl = new Label();
lbl.ID = "lbl" + i.ToString();
---------------------------
} }
but i don't know how to set the data for the particular id.
so pls help me this.
thanks in advance