asp.net mssql连接错误 [英] asp.net mssql connection error

查看:103
本文介绍了asp.net mssql连接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我为我的电脑提供了SQLSERVER 2012 Exspress。我可以使用带有Windows身份验证和Sql Server身份验证的Microsoft Sql Server Management Studio连接到我的数据库。

但是当我尝试连接我的ASP.net应用程序时,会收到以下错误消息:

建立与SQL Server的连接时发生与网络相关或特定于实例的错误。未找到服务器或无法访问服务器。验证实例名称是否正确以及SQL Server是否配置为允许远程连接。(提供者:命名管道提供程序,错误:40 - 无法打开与SQL Server的连接)

我读了很多解决方案但是无法访问。



感谢您的回答

Hi,

I buid to my computer SQLSERVER 2012 Exspress. I can connect to my database with Microsoft Sql Server Management Studio with windows Authentication and Sql Server Authentication.
But when ı try to connect with my ASP.net application ı get this error message:
"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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
I read the lots of solution but ı can not access.

Thanks for your answers

推荐答案

如果您在Win7上运行,请尝试重新启动SQL服务器。

打开任务管理器(ctrl + shift + esc)。

选择服务选项卡。

单击底部的服务按钮。这将为您提供机器上的所有运行服务。

找到MSSQLSERVER。

点击开始或重启。



我认为这应解决问题
If you are running on Win7, try to restart the SQL server.
Open the task manager (ctrl+shift+esc).
Select the Services Tab.
Click on the bottom button 'services'. This will give you all rhe running services on the machine.
Locate MSSQLSERVER.
Click on Start or Restart.

I think this should solve the problem


在SQL Server配置管理器中,转到SQL Native Client(版本)配置 - 客户端协议并激活共享内存,TCP / IP,命名管道。

如果适用,请为32位和64位部分执行此操作。

重新启动SQL Server,然后重试。

还要确保IIS的帐户具有对您的数据库的访问权限(您可能会暂时出于测试目的使用您的用户帐户运行IIS - 请勿在生产中执行此操作!)。
In SQL Server Configuration Manager, go to "SQL Native Client (version) Configuration" - Client protocols and activate shared memory, TCP/IP, named pipes.
If applicable, do that for both "32 bit" and "64 bit" sections.
Restart your SQL Server, and try again.
Also make sure that the account of the IIS has access rights to your database (you may temporarily for testing purposes run IIS with your user account - do not do that in production!).


这篇关于asp.net mssql连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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