问题
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.
回答1:
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!
来源:https://stackoverflow.com/questions/13067119/putting-data-from-sqldatareader-into-html-table