更改数据库名称 - 数据表适配器损坏
我们最近更改了 Web 应用程序正在使用的 SQL 数据库的名称。现在,每个 DataTableAdapter 将更新为新的 ConnectionString。
我们的设置如下:
1)接口(网站项目)
2)业务逻辑(类库项目)
3)数据访问(类库项目)--->包含许多 DataSet 类
Data Access 项目的 app.config 包含唯一的连接字符串。创建每个 DataTableAdapter 时,向导会正确指向它。现在,我们必须更改 ConnectionString,并且所有现有的 DataTableAdapter(大约 60 个)都将无法工作。
仅仅改变 ConnectionString 是行不通的。我缺少什么?
谢谢
We've recently changed the name of the SQL DataBase our WebApp is using. Now, each of the DataTableAdapters will update to the new ConnectionString.
Our setup is as follows:
1) Interface (WebSite Project)
2) Business Logic (Class Library Project)
3) Data Access (Class Library Project) ---> Contains many DataSet classes
The app.config of the Data Access project contains the only connection string. When creating each of the DataTableAdapters, the wizard points to it correctly. Now, we've had to change the ConnectionString, and all of the existing DataTableAdapters (about ~60) will not work.
Simply changing the ConnectionString has not worked. What am I missing?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保配置中的连接字符串名称与设置文件中的连接字符串名称相同。因为在生成的代码中,当它初始化连接字符串时,它设置连接字符串如下:
确保在您的应用程序配置中,连接字符串的名称相同。例如
Make sure the connection string name in your config is the same as the one in the Settings File. Because in the generated code, when it initialzed the connectionstring it setting the connection string as follow :
Make sure that in your app config the name of your connectionString is the same. for example
问题出在
Settings.Designer.cs
文件中。它是一个自动生成的文件,在正常更新/清理/构建过程后不会更新。谢谢大家:-)
The problem was in the
Settings.Designer.cs
file. Its an auto-generated file that did not update after the normal updating/clean/build process.Thanks Everyone :-)