I have some data in a database that I read out with SqlDataReader.

I want to put these in a HTML table in my ASP.NET site, but I can't figure out how to do so.

share|improve this question
you can use the grid view or the list view such type of data controls to display the data from the database on to the html files – Raghurocks Oct 25 '12 at 11:00
Your question is too vague. Please read some online tutorials on how to work with ASP.NET and come back when you've got a more specific question about this. – Steven Oct 25 '12 at 11:03
@Steven I do have some basic knowledge about ASP.NET, but I just need some code examples for how to get data from a database into a HTML table. – Frederik Nielsen Oct 25 '12 at 11:21

1 Answer

up vote 1 down vote accepted

You can use a gridview. It is an asp.net control which you just bind your datareader to your gridview, and it will display every row that is returned from your database as an html table row. You can even combine two or more columns, and add pictures or links instead of just displaying the data with a templated row. Google it and you'll find lots of examples!

share|improve this answer
This is just the solution I need. Thanks :) – Frederik Nielsen Oct 25 '12 at 14:41

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.