C# 报表向导和实体框架

发布于 2024-08-24 07:50:13 字数 407 浏览 2 评论 0原文

这可能很简单,但我只是不知道如何做到这一点...

我有一个合理的复杂 SQL Server 数据库,其中包含多个数据模式和一个通用视图来提供所有这些视图的信息。 (基本上,它列出了所有架构的所有扩展属性。)此设置无法更改,因为每个架构都特定于一个办公室,而整个数据库包含所有公司数据。

我正在使用实体框架连接到这些架构内的所有数据并将它们链接在一起。这使得检索我需要的任何数据变得容易。因此,配置文件包含实体框架的一个连接字符串。

我还使用单个报告来创建所有架构数据的矩阵概述。这是一个基于视图的矩阵,具有三个字段:架构名称、字段和值。该报告将模式名称垂直放置为行标题,将字段名称水平放置为列标题,并将值放置在单元格中。但此报告在配置中使用它自己的连接字符串。

我需要两者共享相同的连接!或者至少配置中有相同的连接字符串。我有什么选择?

This is probably quite simple, but I just don't know how to do this...

I have a reasonable complex SQL Server database containing multiple schema's for data and a generic view to provide information over all those views. (Basically, it lists all extended properties of all schema's.) This setup cannot be changed since every schema is specific for one single office, while the whole database contains all company data.

I'm using the Entity framework to connect to all the data inside those schema's and to link them together. This makes it easy to retrieve whatever data I need. Thus, the configuration file contains one connection string for the entity framework.

I'm also using a single report to create a matrix overview of all the schema data. This is a matrix based on a view with three fields: Schemaname, field and value. The report puts the schemaname vertical as row-header, fieldname horizontal as column header and the value in the cells. But this report uses it's own connection string in the configuration.

I need both to share the same connection! Or at least the same connection string in the configuration. What options do I have?

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

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

发布评论

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

评论(1

纵性 2024-08-31 07:50:13

从 EF 连接字符串检索数据库连接字符串很简单。使用 EntityConnectionStringBuilder 解析它。您还可以提供与 EF 上下文的连接

It's trivial to retrieve the DB connectionstring from the EF connectionstring. Use EntityConnectionStringBuilder to parse it. You can also supply a connection to an EF context.

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