本文介绍了无法连接到SQLSERVER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着到远程SQL服务器上安装asp.net会员制度,但这个错误显示出来:

安装失败。

例外:
无法连接到SQL Server数据库。


失败的详细信息

  System.Web.HttpException(0X80004005):无法连接到SQL Server数据库。 ---> System.Data.SqlClient.SqlException(0x80131904):连接成功与服务器建立的,但随后的pre-登录握手期间发生了错误。 (提供者:SSL提供程序,error:0  - 等待操作超时。)---> System.ComponentModel.Win32Exception(0x80004005的):等待操作超时
   在System.Data.SqlClient.SqlInternalConnection.OnError(SqlException异常,布尔breakConnection,Action`1 wrapCloseInAction)
   在System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj,布尔callerHasConnectionLock,布尔asyncClose)
   在System.Data.SqlClient.TdsParser.Consume preLoginHandshake(布尔加密,布尔trustServerCert,布尔integratedSecurity,布尔和放大器; marsCapable)
   在System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,SqlInternalConnectionTds connHandler,布尔ignoreSniOpenTimeout,Int64的timerExpire,布尔值加密,布尔trustServerCert,布尔integratedSecurity布尔withFailover)
   在System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo,字符串NEWPASSWORD,SecureString的newSecurePassword,布尔ignoreSniOpenTimeout,TimeoutTimer超时,布尔withFailover)
   在System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo,字符串NEWPASSWORD,SecureString的newSecurePassword,布尔redirectedUserInstance,SqlConnectionString connectionOptions,SqlCredential凭证,TimeoutTimer超时)
   在System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer超时,SqlConnectionString connectionOptions,SqlCredential凭证,字符串NEWPASSWORD,SecureString的newSecurePassword,布尔redirectedUserInstance)
   在System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity身份,SqlConnectionString connectionOptions,SqlCredential凭证,对象providerInfo,字符串NEWPASSWORD,SecureString的newSecurePassword,布尔redirectedUserInstance,SqlConnectionString userConnectionOptions)
   在System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions选项,DbConnectionPoolKey poolKey,对象poolGroupProviderInfo,池类DBConnectionPool,的DbConnection owningConnection,DbConnectionOptions USEROPTIONS)
   在System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(池类DBConnectionPool,DbConnectionOptions选项,DbConnectionPoolKey poolKey,DbConnectionOptions USEROPTIONS)
   在System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions USEROPTIONS)
   在System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions USEROPTIONS)
   在System.Data.ProviderBase.DbConnectionPool.TryGetConnection(的DbConnection owningObject,UInt32的waitForMultipleObjectsTimeout,布尔allowCreate,布尔onlyOneCheckConnection,DbConnectionOptions USEROPTIONS,DbConnectionInternal&安培;连接)
   在System.Data.ProviderBase.DbConnectionPool.TryGetConnection(的DbConnection owningObject,TaskCompletionSource`1重试,DbConnectionOptions USEROPTIONS,DbConnectionInternal&安培;连接)
   在System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(的DbConnection owningConnection,TaskCompletionSource`1重试,DbConnectionOptions USEROPTIONS,DbConnectionInternal&安培;连接)
   在System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(的DbConnection outerConnection,DbConnectionFactory connectionFactory的,TaskCompletionSource`1重试,DbConnectionOptions USEROPTIONS)
   在System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1重试)
   在System.Data.SqlClient.SqlConnection.Open()
   在System.Web.Management.SqlServices.GetSqlConnection(字符串服务器,用户字符串,字符串密码,布尔信赖,字符串的connectionString)
ClientConnectionId:24557c63-f9b1-498c-bd1d-0d678f29f795
   在System.Web.Management.SqlServices.GetSqlConnection(字符串服务器,用户字符串,字符串密码,布尔信赖,字符串的connectionString)
   在System.Web.Management.SqlServices.SetupApplicationServices(字符串服务器,用户字符串,字符串密码,布尔信赖,字符串的connectionString,数据库字符串,字符串dbFileName,SqlFeatures功能,布尔安装)
   在System.Web.Management.ConfirmPanel.Execute()

我有一个连接到远程SQL Server从vs2012同样的问题


解决方案

如果一个或多个下列条件为真,则可能会出现此问题:


  • SQL Server未配置为接受远程连接。

  • SQL Server的必要的协议则不予运行的BizTalk Server SQL Server计算机或SQL Server客户端计算机上启用。

执行这些步骤可能会解决此问题:


  • SQL Server外围应用配置工具无法使用SQL Server 2008上启用对SQL Server 2008的计算机上的SQL Server远程连接遵循的SQL Server 2008联机说明帮助。


  • 使用 SQL Server配置管理器工具来启用的 TCP / IP 和/或在命名管道的协议上的SQL服务器计算机。


    1. 点击开始,点所有程序,然后点击 SQL Server配置管理器


    2. 点击展开的 SQL Server网络配置,然后点击为MSSQLSERVER协议


    3. 右键单击 TCP / IP 的协议,然后点击启用


    4. 右键单击命名管道的协议,然后点击启用


    5. 关闭 SQL Server配置管理器工具。



  • 使用 SQL Server配置管理器工具来启用的 TCP / IP 和/或在命名管道的协议上的SQL正在运行的BizTalk Server服务器客户端计算机。


    1. 点击开始,点所有程序,然后点击 SQL Server配置管理器


    2. 点击展开的 SQL Server网络配置,然后点击 ClientProtocols的


    3. 右键单击 TCP / IP 的协议,然后点击启用


    4. 右键单击命名管道的协议,然后点击启用


    5. 关闭 SQL Server配置管理器工具。



注意:确保运行BizTalk Server SQL Server客户端计算机上的协议,至少有一个相匹配的SQL Server计算机上启用的协议

Im trying to install asp.net membership system on a remote sql server but this error shows up:

Setup failed.

Exception:Unable to connect to SQL Server database.


Details of failure

System.Web.HttpException (0x80004005): Unable to connect to SQL Server database. ---> System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.) ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean& marsCapable)
   at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString)
ClientConnectionId:24557c63-f9b1-498c-bd1d-0d678f29f795
   at System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString)
   at System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install)
   at System.Web.Management.ConfirmPanel.Execute()

I have the same problem with connecting to remote sql server from vs2012

解决方案

This problem may occur if one or more of the following conditions is true:

  • SQL Server is not configured to accept remote connections.
  • The necessary protocols for SQL Server are not enabled on either the SQL Server computer or the SQL Server client computer that is running BizTalk Server.

Following these steps may resolve this problem:

  • The SQL Server Surface Area Configuration tool is not available on SQL Server 2008. To enable remote connections for SQL Server on a SQL Server 2008 computer follow the instructions in the SQL Server 2008 online help.

  • Use the SQL Server Configuration Manager tool to enable the TCP/IP and/or the Named Pipes protocols on the SQL Server computer.

    1. Click Start, point to All Programs, and click SQL Server Configuration Manager.

    2. Click to expand SQL Server Network Configuration and then click Protocols for MSSQLSERVER.

    3. Right-click the TCP/IP protocol and then click Enable.

    4. Right-click the Named Pipes protocol and then click Enable.

    5. Close the SQL Server Configuration Manager tool.

  • Use the SQL Server Configuration Manager tool to enable the TCP/IP and/or the Named Pipes protocols on the SQL Server client computer that is running BizTalk Server.

    1. Click Start, point to All Programs, and click SQL Server Configuration Manager.

    2. Click to expand SQL Server Network Configuration and then click ClientProtocols.

    3. Right-click the TCP/IP protocol and then click Enable.

    4. Right-click the Named Pipes protocol and then click Enable.

    5. Close the SQL Server Configuration Manager tool.

Note: Ensure that at least one of the protocols on the SQL Server client computer that is running BizTalk Server matches the protocols enabled on the SQL Server computer.

这篇关于无法连接到SQLSERVER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 03:29