Click here to Skip to main content
15,907,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am currently working on a project which deals with retrieving data from sql server database and display the data in html table in my .aspx page. Can anyone help me figure out this problem
Posted
Comments
ZurdoDev 7-Sep-12 8:50am    
What exactly is the problem?
Malli_S 7-Sep-12 8:51am    
What's the problem? User 'Improve question' link to update your question.

http://msdn.microsoft.com/en-us/library/tw738475.aspx[^]

But seriously, there are plenty of examples on www.asp.net covering data access. And probably a billion other blogs out there.
 
Share this answer
 
C#
DataTable objDataTableReceiptDetails = new DataTable();
            objSiteRegistrationBLL.SiteGetReceiptDetails(objSiteBookingDTO, ref objDataTableReceiptDetails);
            string table = "<table>";
            for (int i = 0; i < objDataTableReceiptDetails.Rows.Count; i++)
            {
                table =table+ string.Format("<tr><td>" + objDataTableReceiptDetails.Rows[i][0].ToString() + "</td><td>" + objDataTableReceiptDetails.Rows[i][1].ToString()+"</td></tr>");
                
            }
            table = table + "</table>";

            Response.Write(table);



Hope this will help you
 
Share this answer
 

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