我下面這個教程:http://chsakell.com/2015/08/23/building-single-page-applications-using-web-api-and-angularjs-free-e-book/無法連接到Visual Studio的2013的LocalDB採用了棱角分明-JS
並在下面的連接字符串:
<add name="HomeCinema" connectionString="Data Source=(LocalDb)\v11.0;
Initial Catalog=HomeCinema;Integrated Security=SSPI;
MultipleActiveResultSets=true"
providerName="System.Data.SqlClient" />
當我嘗試運行最新情況:數據庫-verbose在命令行,我發現了以下錯誤:
A network-related or instance-specific error occurred while establishing a connection to
SQL Server. The server was not found or was not accessible. Verify that the instance name
is correct and that SQL Server is configured to allow remote connections.
(provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
我試圖連接到隨附的LocalDB Visual Studio 2013
。
當我看到輸出:
Target database is: 'HomeCinema'
(DataSource: .\SQLEXPRESS, Provider: System.Data.SqlClient, Origin: Convention).
這是構造:
public HomeCinemaContext()
: base("HomeCinema")
{
Database.SetInitializer<HomeCinemaContext>(null);
}
謝謝。
本地數據庫自帶的Visual Studio 2013?它實際上會有用還是僅僅用於一些測試? –
請原諒我的無知。我正在使用VS13。我在說什麼localdb可以在本地訪問。 – Richard77
如果你仔細地點擊你的項目,那麼你可以添加一個數據庫連接(實體或只是sql,但實體更有趣的工作)automaticaly與每一個必要的信息也automaticaly寫在你的web.config –