使用 ASP.NET MVC 进行数据仓库

发布于 2024-10-11 07:00:24 字数 216 浏览 0 评论 0原文

一台服务器上有20多个结构相同但数据不同的数据库。我需要从所有数据库收集一些数据(相同的查询)并存储在位于另一台服务器上的新数据库中。我决定使用 ASP.NET MVC 2,但使用超过 20 个“LINQ to SQL 类”(.dbml) 文件似乎不合逻辑,因为所有数据库的结构都是相同的,而且如果我使用这么多,它就会重复这些文件。是否有一种简单的方法来使用一个 .dbml 文件(用于远程数据库)但仅更改连接字符串?

On one server there are more than 20 databases with identical structure but different data. I need to collect some of the data (the same queries) from all databases and store in new database which is located on another server. I decided to use ASP.NET MVC 2 but it doesn't seem logical to use more than 20 "LINQ to SQL Classes" (.dbml) files because the structure is the same for all databases and it's repeating if I use so many of these files. Is there a simple way to use one .dbml file (for remote databases) but change only connection string?

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

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

发布评论

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

评论(3

强辩 2024-10-18 07:00:25

根据this,可以使用dataContext构造函数传入连接字符串。因此,从理论上讲,您应该能够拥有一个 dbml 文件,但您可以实例化数据上下文的多个实例,每个实例都指定不同的数据库连接字符串。每个上下文应该指向各自的数据库,并允许您使用多个数据库。

According to this, you can pass in a connection string with the dataContext constructor. So theoretically, you should be able to have one dbml file, but you can instantiate multiple instances of your data context, each with a different database connection string specified. Each context should then point to their respective database and allow you to work with multiple databases.

一念一轮回 2024-10-18 07:00:25

为什么要使用 ASP.NET MVC? ASP.NET 用于 Web UI,而不是数据仓库(除非您需要显示多维数据集)。看来您使用的是 SQL Server。如果确实如此,您可以利用集成服务(例如 DTS)来完成这项工作。

Why do you want to use ASP.NET MVC at all? ASP.NET is for web UI, not data warehousing (except when you need to display cubes). Looks like you use SQL Server. If that is true you can utilize Integration Services (ex DTS) to do the job.

滥情稳全场 2024-10-18 07:00:24

我同意您确实不想使用 MVC,因为它是一个 Web 框架,与移动数据无关。

您还可以考虑使用 ETL 工具来完成此任务。我过去曾成功地使用RhinoETL 完成过类似的事情。

该网站上还有多个讨论 ETL 工具的帖子。例如,检查以下链接 - https://stackoverflow.com/questions/51198/你用什么etl工具

I agree that you really wouldn't want to use MVC as that is a web framework and has nothing to do with moving data around.

You can also look into using an ETL tool to accomplish this task. I have used RhinoETL in the past successfully to accomplish something similar.

There are also multiple posts on this site discussing ETL tools. For example, check the following link - https://stackoverflow.com/questions/51198/what-etl-tool-do-you-use

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