ASP.NET MVC 2:连接字符串错误?

发布于 2024-10-05 08:57:21 字数 388 浏览 0 评论 0原文

我需要重新开始一个新的 MVC 2 项目

这就是错误所指出的:

public DealDataContext() : 
                    base(global::System.Configuration.ConfigurationManager.ConnectionStrings["RESTRO_DEVConnectionString"].ConnectionString, mappingSource)
            {
                OnCreated();
            }

两个项目之间的唯一区别可能是第一个项目不是空的 MVC 2 项目...而第二个项目是。

是否有一些不同的定义或设置?

I needed to start fresh with a new MVC 2 Project

This is what the error points to:

public DealDataContext() : 
                    base(global::System.Configuration.ConfigurationManager.ConnectionStrings["RESTRO_DEVConnectionString"].ConnectionString, mappingSource)
            {
                OnCreated();
            }

The only difference between the two projects could possibly that the first one was not an EMPTY MVC 2 Project... whereas the second one was.

Are there some definitions or settings that differ?

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

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

发布评论

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

评论(1

っ左 2024-10-12 08:57:21

这将在 web.config 文件中查找连接字符串。连接字符串在该 web.config 文件中名为“RESTRO_DEVConnectionString”。

如果新的 web.config 文件中没有此内容,您可以从原始 web.config 文件中复制 XML 行。

This is looking for a connection string in a web.config file. The connection string is named "RESTRO_DEVConnectionString" in that web.config file.

If you don't have this in your new web.config file, you can probably copy the line of XML fro the original web.config file.

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