错误 40:无法打开与 SQL Server 的连接 [英] Error 40: Could not open a connection to SQL Server

查看:32
本文介绍了错误 40:无法打开与 SQL Server 的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的计算机上运行 Windows 应用程序,但是当我连接到我的 SQL Server 数据库时发生错误,内容为

I am running a windows application on my computer but, while I connect to my SQL Server database an error occurs which says

命名管道错误 40 无法打开与 SQL 服务器的连接.

Named pipes Error 40 Could not open a connection to SQL server.

我尝试了几个 MSDN 页面和链接,包括防火墙设置更改、SQL 配置设置,但没有任何效果.

I tried several MSDN pages and links, which includes firewall setting change, SQL configuration settings, but nothing works.

请帮忙

推荐答案

SOLVED !!简单地说,而不是使用Microsoft SQL Server (SqlClient)"作为数据源使用.NET Framework Data Provider for MySQL"将您的凭据用于 MySQL 连接(服务器名称、用户、密码、数据库可选)现在应该可以使用了.

SOLVED !! Simply, Instead of using "Microsoft SQL Server (SqlClient)" as The DataSource Use ".NET Framework Data Provider for MySQL" Use your Credentials for the MySQL Connection (ServerName,User,Password,DB-Optional) It should work now.

我为我的项目使用了 ADO 实体数据模型向导,并将 .Net 配置为我的数据源.如果您在不同的场合遇到错误 40...",请验证您的数据源是否正确.

I've used ADO Entity DATA Model Wizard for My Project and configure .Net as My DataSource. If you have the "error 40..." in different occausion verify your DataSource to the right one.

我像你们中的大多数人一样尝试寻找防火墙设置、服务器设置、但它比我想象的要简单,所以检查一下...

I tried like most of you to look for Firewall settings, server settings, but it was simple than i thought, so check it out...

下载 ---> .NET Framework Data Provider for MySQL 作为您的数据源/提供程序:

For download --->.NET Framework Data Provider for MySQL as your data source/provider:

http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-6.7.4.msi

它对我有用!

这篇关于错误 40:无法打开与 SQL Server 的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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