无法从 Visual Studio 2012 连接到 SQL Server Express 2014 [英] Cannot connect to SQL Server Express 2014 from Visual Studio 2012

查看:35
本文介绍了无法从 Visual Studio 2012 连接到 SQL Server Express 2014的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是关于将数据从 SQL Server (Express 2014) 检索到 Visual Studio (Professional 2012).我正在关注下拉列表的重新使用教程.当我使用选择数据源"时,我可以继续选择数据库.当我尝试使用Microsoft SQL Server 数据库文件 (SqlClient)"并从我的 App_Data 文件夹中选择NORTHWND.MDF"时,出现此错误:

My question is regarding retrieving data from SQL Server (Express 2014) into Visual Studio (Professional 2012). I am following a tutorial re usage of the drop down list. When I use 'Choose Data Source' I can proceed as far as selecting the database. When I try to use 'Microsoft SQL Server Database File (SqlClient)' and select 'NORTHWND.MDF' from my App_Data folder I get this error:

尝试附加到数据库失败,并显示以下信息:建立时发生与网络相关或特定于实例的错误与 SQL Server 的连接.服务器未找到或无法访问.验证实例名称是否正确以及 SQL Server 是否配置为允许远程连接(提供者:SQL 网络接口,错误:50 - 本地发生数据库运行时错误.无法创建自动实例.看窗户错误详细信息的应用程序事件日志.)

The attempt to attach to the database failed with the following information: A network-related or instance-specific error occurred while establishing an 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:50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.)

我的日志中没有关于此的任何内容.

I have nothing in the log re this.

当我尝试使用Microsoft SQL Server"连接到 SQL Server 时,我可以访问 SQL Server 实例,选择数据库并获得连接成功",但在确定时出现此错误:

When I try and connect to SQL Server using 'Microsoft SQL Server' I can get to the SQL Server Instance, select the database and get 'Connection Successful' but on OK get this error:

无法加载文件或程序集Microsoft.SqlServer.Management.Sdk.Sfc,版本 11.0.0.0Culture=neutral, Public Key Token=89845dcd8080cc91' 或其依赖项之一.系统找不到指定的文件.

Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version 11.0.0.0 Culture=neutral, Public Key Token=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

我已经安装了 SQLLocalDB.

I have installed SQLLocalDB.

非常感谢帮助,因为这阻碍了我的学习.谢谢.

Help greatly appreciated as this is holding up my studies. Thank you.

推荐答案

我终于在应用程序事件日志中发现了一条消息,指出了一个不兼容问题...我推测这是在 VS 2012 和 SQL Server 2014 之间.因此我安装了 SQL Server 2012.随后在 VS 2012 中运行Web 应用程序",我发现自动创建的页面中的注册"功能正确创建了一个用户,而以前它因最初发布的错误而失败.我假设 VS 2012 中所有与 SQL Server 相关的活动现在都可以工作,但如果我发现其他情况,我会在这里报告.

I finally found a message in the application event log which pointed out an incompatibility issue... I presumed this was between VS 2012 and SQL Server 2014. Accordingly I installed SQL Server 2012. Subsequently running a 'Web Application' in VS 2012 I found that the 'Register' function in the automatically created page correctly created a user whereas previously it had failed with the error originally posted. I am assuming that all SQL Server related activities in VS 2012 will now work, but will report back here if I find otherwise.

这篇关于无法从 Visual Studio 2012 连接到 SQL Server Express 2014的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆