尝试在 SubSonic 下查询数据库时找不到连接字符串
无论我使用哪个版本的 SubSonic,我都会收到此错误。当我查询数据库数据时,它出错,说无法连接到数据库。
但是,当被告知这样做时,它能够生成 .cs 类(ActiveRecord、Context 等)。
任何帮助表示赞赏。
谢谢各位...
I get this error no matter what version of SubSonic I use. When I query the database for data, it errors out, saying it can not connect to the database.
However, it is able to generate the .cs classes(ActiveRecord, Context, etc) when told to do so.
Any help is appreciated.
Thanks folks...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的猜测是,您的 SubSonic 生成的类位于与主应用程序所在的单独项目中(在同一解决方案中的另一个项目中)。您的主应用程序项目引用包含 SubSonic 生成的类的项目。
如果是这种情况,您的主应用程序项目还必须在配置文件中包含连接字符串,类似于其他项目的连接字符串。您可能还需要从其他项目的配置文件中复制一些其他 SubSonic 相关项目。
My guess is that you have your SubSonic generated classes in a separate project from where your main application is (in another project in the same solution). Your main application project references the project containg the SubSonic generated classes.
If this is the case, your main application project must also contain the connection string in a config file, similarly to what your other project has. You might also need to copy over some of the other SubSonic related items from your other project's config file as well.