locked
Error: 25 - Connection string is not valid (.Net SqlClient Data Provider) RRS feed

  • Question

  • Hi, I just installed SQL Server 2008 full edition on my machine but am not able to connect to the default MSSQLSERVER database.  When I set it up, I specified Windows authentication.  And so that is how I try to connect to it.  And even though I see the MSSQLSERVER service in the Sql Server Configuration Manager, I still can't connect to it.  I tried modifying the protocols and even enabling FILESTREAM, but none of this helped.  How can I fix this?

    ===================================

    Cannot connect to D610-M\MSSQLSERVER.

    ===================================

    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: SQL Network Interfaces, error: 25 - Connection string is not valid) (.Net SqlClient Data Provider)

    ------------------------------

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=87&LinkId=20476

    ------------------------------

    Error Number: 87

    Severity: 20

    State: 0

     

    ------------------------------

    Program Location:

    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.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)

    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 Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ValidateConnection(UIConnectionInfo ci, IServerType server)

    at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

    Thursday, December 3, 2009 3:16 AM

Answers

  • I suspect you have installed default instance and I could find wrong information in the connection string.

    Cannot connect to D610-M\MSSQLSERVER.

    MSSQLSERVER is for default instance, hence just provide the server name alone in the connection string. Like D610-M and don't use \MSSQLServer.
    Vidhya Sagar. Mark as Answer if it helps!
    • Marked as answer by Ryan D Thursday, December 3, 2009 11:34 AM
    Thursday, December 3, 2009 9:17 AM

All replies

  • Are you using the correct instance name for SQL instances in your connection string or SQL server management studio ?
    Thanks, Leks
    • Proposed as answer by D A P Tuesday, April 11, 2017 1:36 AM
    • Unproposed as answer by D A P Tuesday, April 11, 2017 1:36 AM
    Thursday, December 3, 2009 6:23 AM
  • I suspect you have installed default instance and I could find wrong information in the connection string.

    Cannot connect to D610-M\MSSQLSERVER.

    MSSQLSERVER is for default instance, hence just provide the server name alone in the connection string. Like D610-M and don't use \MSSQLServer.
    Vidhya Sagar. Mark as Answer if it helps!
    • Marked as answer by Ryan D Thursday, December 3, 2009 11:34 AM
    Thursday, December 3, 2009 9:17 AM
  • I tried to figure this out for over 3hrs and finally got it because of your comments. Yes, just use your Computer name or Hostname to login to Database Engine...Thanks a bunch to VidhyaSagar! You're a genius..=)
    Monday, June 14, 2010 7:03 PM
  • ahh..I struggled for 2 days and finally got it by your answer..thanks a lott and truely u r genius
    Friday, July 23, 2010 6:32 PM
  • Great .. Just use the instance name and do not use the HOST NAME , It works ... Thanks Vidhya Sagar ...
    Wednesday, June 15, 2011 8:49 PM
  • Thanks a lot it helped me fixed my current issue!
    Tuesday, March 6, 2018 3:29 PM
  • This worked for me
    Friday, May 4, 2018 5:18 PM