我下面这个教程: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 –