Subsonic ActiveRecord 和 SQL Server Express
我正在尝试 Subsonic ActiveRecord 来确定我是否想在即将进行的项目中使用它,我得说到目前为止我真的很喜欢它。它与 MS SQL Server 2005 和 2008 配合得很好,但我在使用 T4 模板和 SQL Server Express 时遇到了问题。据我所知,Subsonic 在从我添加到测试 MVC 应用程序的 Server Express 数据库获取架构信息时遇到问题。
有谁知道如何让它与 Server Server Express (不是 Compact) 一起使用,以及 Subsonic 3.0.0.4 是否支持它?
编辑: 这是一个 MVC 应用程序,MyTestDB 位于 App_Data 文件夹中。我尝试了许多不同的连接字符串,但似乎没有任何效果。我使用的最后一个字符串是:
<connectionStrings>
<add name="MyTestDBString" connectionString="server=.\SQLExpress;database=MyTestDB;integrated security=SSPI;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionstrings>
使用上面的字符串,我在 Visual Studio 的错误列表中收到 SQL 异常,提示 无法打开数据库...登录失败
。当我右键单击 .tt
文件并运行自定义工具时,会发生这种情况。
I am trying out Subsonic ActiveRecord to determine if I want to use it on any upcoming projects, and I gotta say I really like it so far. It worked great with MS SQL Server 2005 and 2008, but I am having problems with the T4 Templates and SQL Server Express. From what I can tell, Subsonic is having a problem getting the schema info from the Server Express database that I added to a test MVC app.
Does anyone have info on getting it to work with Server Server Express (not Compact), and whether its even supported in Subsonic 3.0.0.4?
EDIT:
This is an MVC app with MyTestDB in the App_Data folder. I have tried a number of various connection strings but nothing seems to work. The last string I have used is:
<connectionStrings>
<add name="MyTestDBString" connectionString="server=.\SQLExpress;database=MyTestDB;integrated security=SSPI;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionstrings>
With the above string I am getting an SQL exception in the error list in Visual Studio saying Cannot Open Database... The login failed
. This happens when I right click on the .tt
files and run a custom tool.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您忘记指定要附加到用户 SQL Server 实例的数据库文件。例如:
请参阅打开用户实例连接< /a> 和 使用 Subsonic 构建 ASP.NET MVC 应用程序3.0。
希望一切顺利。祝你好运!
You forgot to specify what database file to attach to a User SQL Server Instance. For example:
See Opening a User-Instance Connection and Building your ASP.NET MVC application with Subsonic 3.0.
Hope it works out. Good luck!