如何在标签上显示数据库记录? [英] How to display database records on lable..?

查看:150
本文介绍了如何在标签上显示数据库记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以表格格式显示我的数据库记录.PLZ建议我



我尝试过:



i不知道怎么做...

i want to display my database records on lable in table format.. plz suggest me

What I have tried:

i don't know how to do that...

推荐答案

你没有 - 标签是旨在显示单条信息的小型控件。您需要一个支持基于行和列的数据的控件(就像您的数据库一样),例如GridView或DataGridView,具体取决于您的代码编写在其下运行的环境 - 基于Web的控件与WinForms不同,后者与WPF不同, UWP再次与众不同,等等。



首先查看VS中的工具箱并查看可用的控件,然后查看MSDN文档。
You don't - a label is a small control intended to to display a single piece of information. You need a control which supports row and column based data (just like your database does) such as a GridView or DataGridView depending on the environment your code is written to run under - web based controls are different from WinForms, which are different from WPF, UWP are yet again different, and so on.

Start by looking at the Toolbox in VS and see what controls you have available, then look at the MSDN documentation for them.


检查这个使用C#和VB.Net在ASP.Net中的HTML表格中显示DataTable [ ^ ]


使用GridView with< ;模板列><&的ItemTemplate GT;并将每个列值绑定到标签。



参考下面的文章了解更多详情。

设置asp的值:gridView中的标签asp:TemplateField | ASP.NET论坛
Use GridView with <templatefield><itemtemplate> and bind each column value to the label.

refer below article for more details.
Set value for asp:Label inside gridView asp:TemplateField | The ASP.NET Forums


这篇关于如何在标签上显示数据库记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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