今天我花了6小时时间,想要在 Visual Studios 2012 中连接我的 SQL Server 2012 数据库,但是最终放弃了。
设置:
- Database:
App_Data/GameDB.mdf
- DB Location:
C:\Users\USERNAME\Documents\Visual Studio 2012\Projects\ProjectRawWar\ProjectRawWar\App_Data\GameDB.mdf
Connection string:
<add name="LocalSqlServer" connectionString="Data Source=(LocalDB)\v11.0;Initial Catalog=GameDB;Integrated Security=False;"/>
I first tried a SQL Server Compact database, didn't work.
- I tried many other connection strings from connectionstrings.com, didn't work.
- I tried to put the full path of the database in the connection string, didn't work.
有人可以帮我摆脱痛苦吗?
更新: 我刚刚遵循了http://msdn.microsoft.com/en-us/library/aa983322.aspx。 数据库在那里。我将连接字符串从向导中复制到我的webconfig连接字符串中,仍然无法工作。为什么?逻辑在哪里?