Putting data from SqlDataReader into HTML table

戏子无情 提交于 2020-01-15 08:55:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!