Connection Error

  • I received the error message below from the application when tried connecting to the database using the credentials.

    1. I verified the firewall it is OFF.

    2. I verified the user, and is able to connect to the server using the SQL CLient.

    3. I have verified the server and it doesn't have the Windows authentication on it is has Mixed mode checked. I verified user credentials using the sql server authentication and it works for me but the application is not able to access.

    4. SQL browser is enabled.

    5. SA account is enabled

    6. the application is accessed from Local machine but not from the server

    7. I have used the following connection string

    <add key="SqlServerConnectionString" value="Data Source=IP address,1433;Initial Catalog=DB;uid=Login;password=Pwd" />

    Please suggest !!!!!!

    Error Message:

    System.Data.SqlClient.SqlException: 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)

    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

    at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)

    at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)

    at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)

    at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)

    at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)

    at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)

    at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)

    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

    at System.Data.SqlClient.SqlConnection.Open()

    at clsCommon.fnLoginUser(String vUserID, String vPwd)

    *****************************************************************************************

    Thank you in advance!

  • Do you have named pipes enabled in the sql server network config?

    Are you positive it's running on port 1433?

  • Thank you so much Derrick, for your response.

    Named pipes - I have enabled now and tried. The port number is connected to 1433.

    Had the following error:

    *****************************************************************************************

    Error Location: App_Code\clsCommon.vb\fnLoginUser

    Error Message:

    System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

    at System.Data.SqlClient.SqlConnection.Open()

    at clsCommon.fnLoginUser(String vUserID, String vPwd)

    *****************************************************************************************

  • Good - now it looks like the connection is fine and now it's a code issue.

    That's not really my forte, but here are a few links that look promising and might mean more to a .net developer:

    http://www.15seconds.com/issue/040830.htm

    http://dotnetdebug.net/2007/04/04/systeminvalidoperationexception-timeout-expired-the-timeout-period-elapsed-prior-to-obtaining-a-connection-from-the-pool-this-may-have-occurred-because-all-pooled-connections-were-in-use-and-max/

  • I have recommended the same Derrick.

    Thank you for your prompt response.

    Swetha

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply