从SqlDataReader对象将数据放入HTML表格 [英] Putting data from SqlDataReader into HTML table

查看:329
本文介绍了从SqlDataReader对象将数据放入HTML表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在,我与读出 SqlDataReader的数据库中的一些数据。

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

我想在我的ASP.NET站点把这些在一个HTML表格,但我无法弄清楚如何做到这一点。

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

推荐答案

您可以使用一个gridview。它是你只是你的DataReader绑定到你的GridView一个asp.net控制,它会显示从数据库返回一个HTML表格行的每一行。甚至可以结合两个或多个列,然后添加图片或链接,而不是只用一个模板行显示数据。谷歌它,你会发现很多的例子!

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!

这篇关于从SqlDataReader对象将数据放入HTML表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆