我是新来的Visual Studio和SQL Server Express,所以我很抱歉我缺乏知识。使用Visual Studio无法连接到Microsoft SQL Server 2012 Express
我试图用两种方式进行连接,但它们都不起作用。我首先在web.config
文件中写了<connectionStrings>
元素。
<connectionStrings>
<add name="testDB"
connectionString=" Data Source=(my computer name)\SQLEXPRESS;Initial Catalog=Factory;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
然后我想在SqlDataSource
中使用,并设置数据连接。
但我得到这个消息:
数据库模式无法为这个连接进行检索。请 确保连接设置正确,并且数据库在线为 。
无法加载文件或程序集 ' Microsoft.SqlServer.Management.Sdk.Sfc,版本= 12.0.0.0, 文化=中性公钥= 89845dcd8080cc91' 或没有其 依赖。
即使我尝试通过服务器资源管理器连接(添加连接,然后(my computer name)\EXPRESS
)我收到相同的消息。但我确实找到了所有的标签,并且连接测试正常工作。
我重新安装了SQL Server 2012 Express和SQL Server 2012 Express Management Studio两次。
试试这个字符串模式:Server = myServerName \ myInstanceName; Database = myDataBase; User Id = myUsername; Password = myPassword; – Ionic
没有VS 2014 - 我们有VS 2010,VS 2013和VS 2015 - 但没有2014版本(但是有一个** SQL Server ** 2014版本) –