當我打開使用Visual Studio 2012,我得到以下消息的Visual Studio 2010的解決方案:當我使用Visual Studio 2012打開Visual Studio 2010解決方案時,需要什麼版本的SQL Server?
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename
=|DataDirectory|\databaseName.mdf;Integrated Security=True;User Instance=True"
:
SQL Server Express and LocalDB
在Web.config文件中,我從改變的ConnectionString
發給:
connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename
=|DataDirectory|\databaseName.mdf;Integrated Security=True"
我不能與數據庫連接,當我運行該應用程序我還是得到一個錯誤信息:
An attempt to attach an auto-named database for file (FILE) failed.
A database with the same name exists, or specified file cannot be opened,
or it is located on UNC share.
The attempt to attach to the database failed with the following information:
Failed to generate a user instance of SQL Server due to a failure in starting
the process for the user instance. The connection will be closed.
爲什麼你在更改數據庫連接字符串嗎?只要打開2010解決方案,VS會提示你任何更新並在web.config中自動生成它們。您的問題實際上是打開解決方案還是連接到其他數據庫? – Tanner
第二個連接字符串上缺少User Instance = True – Steve
使用visual studio 2012打開項目不是問題,但是如何調整數據庫(mdf文件)以使用VS 2012? – Gilko