在网格控件中显示记录(asp.net / vb.net)

发布于 2024-12-10 15:55:03 字数 1009 浏览 2 评论 0原文

我是 .net 开发世界的新手。
我想在我的 asp.net 页面上显示一组记录。

在网格控件(gridview、repeater 等)上,我想显示销售人员及其代表的客户的列表。

这就是它在我的 asp 页面上的样子:

Employee ID: 123456
Name:  John
Last Name: Smith
Email: [email protected]
Phone: 201-123-4567

Client - 1
ClientID: 11111111
Client Name: XYZ Company
Client Contact: John Q Public
Client Phone: 201-222-3333

Client - 2
ClientID: 2222222
Client Name: Widget Company
Client Contact: George Williams
Client Phone: 201-333-4444

Client - 3
ClientID: 3333333
Client Name: Acme Products
Client Contact: Steve Mason
Client Phone: 201-444-3333

我的 sql 查询类似于:

Select sales.firstname, sales.lastname, sales.email, sales.phone sales.clientid from sales

select client.id, client.name, client.contact, client.phone from client, where sales.clientid = sales.clientid

代码将为所有销售记录循环

我的语法将如何构造?

I am a newbie to the .net developing world.
I want to display a set of records on my asp.net page.

On a grid control (gridview, repeater etc), I want to display the list of sales people and the clients that they represent.

This is how it needs to look on my asp page:

Employee ID: 123456
Name:  John
Last Name: Smith
Email: [email protected]
Phone: 201-123-4567

Client - 1
ClientID: 11111111
Client Name: XYZ Company
Client Contact: John Q Public
Client Phone: 201-222-3333

Client - 2
ClientID: 2222222
Client Name: Widget Company
Client Contact: George Williams
Client Phone: 201-333-4444

Client - 3
ClientID: 3333333
Client Name: Acme Products
Client Contact: Steve Mason
Client Phone: 201-444-3333

My sql query is something like:

Select sales.firstname, sales.lastname, sales.email, sales.phone sales.clientid from sales

select client.id, client.name, client.contact, client.phone from client, where sales.clientid = sales.clientid

The code would loop for all sales records

How would my syntax be structured?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南城追梦 2024-12-17 15:55:03

您需要处理GridViewRowDataBound事件。在此处理程序中,您必须获取 Repeater 控件的引用并绑定关联员工 ID 的客户端表的 dataSource

You need to handle the RowDataBound event of GridView. In this handler, you have to obtain the reference of Repeater control and bind the dataSource of client table for associated employee id.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文