locked
error 26 when deployed, but works in vs2010 RRS feed

  • Question

  • User159475415 posted

    Hi,

    I have a web app that has 2 connection strings one for application database and one for the applicationServices security database. Everything works ok when i build the appliaction and run using vs2010, but when i deploy to the sevre there are issues when i try to access on of the fomrs. Initailly i get the login page which works, but then when it trys to use the other connection string it says error 26 its can't find the server. Heres the error:

    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: 26 - Error Locating Server/Instance Specified)

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [SqlException (0x80131904): 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: 26 - Error Locating Server/Instance Specified)]
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5009598
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
       System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +341
       System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +129
       System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +270
       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +5023255
       System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +31
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +76
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
       System.Data.SqlClient.SqlConnection.Open() +125
       System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +82
    
    [HttpException (0x80004005): Unable to connect to SQL Server database.]
       System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +137
       System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +94
       System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +27
       System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString) +395
    

     

    I can't understand why it would work when i run locally, but not on the server. Any Ideas here are the connection strings@

    <

    add name="ApplicationServices" connectionString="Data Source=myServer;Initial Catalog=mySecurityDatabase;Persist Security Info=True;User ID=myUser;Password=MyPassword" providerName="System.Data.SqlClient"/>

    <

    add name="myConnectionstring" connectionString="Data Source=myServer;Initial Catalog=myAppDatabasePersist Security Info=True;User ID=myUser;Password=MyPassword" providerName="System.Data.SqlClient"/>

    They both use the same server same user and same password (is this an issue), but one points at the asp.net security database the other at a database i created. Anyone any ideas what could cause this and how to recitify or even debug as I'm getting no-where.

     

     

    Monday, July 29, 2013 1:49 AM

All replies