Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
If there new items added in database and the name of the new item need to be shown in page as a label i.e every time items added there is a need to take a label to show that. But how dynamically that can be done in ASP.NET.
Posted
Comments
Nandakishore G N 23-Jan-13 5:20am    
present how are you showing?...paste the code..
ghosh arnab 23-Jan-13 5:34am    
string Query = "SELECT ProductName FROM Products WHERE (Product_ID = '1')";

DataSet allUserNames = FillAndReturnDataSet(Query);
lbl1.Text = allUserNames.Tables[0].Rows[0].ItemArray[0].ToString();
string Query1 = "SELECT ProductName FROM Products WHERE (Product_ID = '2')";

DataSet allUserNames1 = FillAndReturnDataSet(Query1);
lbl2 .Text = allUserNames1.Tables[0].Rows[0].ItemArray[0].ToString();
string Query2 = "SELECT ProductName FROM Products WHERE (Product_ID = '3')";

DataSet allUserNames2 = FillAndReturnDataSet(Query2);
lbl3 .Text = allUserNames2.Tables[0].Rows[0].ItemArray[0].ToString();


FillAndReturnDataSet(Query) this is a user defined function which returns dataSet.

how to make this whole thing dynamic?
Nandakishore G N 23-Jan-13 5:51am    
so..you want to pass the productid everytime when you fill data...to label?..where does productid comes from?

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900