如何在VS2010 RDLC报告中链接多个表

发布于 2024-09-26 09:35:14 字数 400 浏览 0 评论 0原文

我有两个通过主键链接在一起的表...作为示例,

Genre
-----
GenreID
GenreDescription

Track
-----
TrackID
GenreID
TrackName

我想显示如下内容:

TrackID Name    Genre
1          Track1   Pop
2          Track2   Pop
3          Track3   Rap
4          Track4   Rock

如何编写自定义 SQL 语句并将字段添加到数据库中?目前,我只能从数据库中选择Table、View、SP和Func。我应该在哪里编写自定义 SQL 语句并连接所需的表?

谢谢。

I have two tables which are linking together by primary key... as an example

Genre
-----
GenreID
GenreDescription

Track
-----
TrackID
GenreID
TrackName

I want to show like the following

TrackID Name    Genre
1          Track1   Pop
2          Track2   Pop
3          Track3   Rap
4          Track4   Rock

How can I write custom SQL statements and add the fields into the database? At the moment, I can only choose Table, View, SP and Func from the Database. Where should I write custom SQL statements and join the required tables?

Thanks.

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

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

发布评论

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

评论(1

↙温凉少女 2024-10-03 09:35:14

您需要通过连接 GenreID 上的 Track 和 Genre 数据集来创建新的数据表。然后将新数据集添加到您的报告中并据此进行设计。

您可以使用自己的 SQL 连接现有表,在设计器中轻松创建新数据表。

You will need to create a new data table by joining the Track and Genre data sets on GenreID. Then add the new data set to your report and design off that.

You can easily create new data tables in designer by using your own SQL to join from existing tables.

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