Page view counter

GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

Last post 10-05-2008 4:24 PM by nmartin. 13 replies.

Sort Posts:

  • GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    08-11-2008, 1:42 PM
    • Loading...
    • amreddy
    • Joined on 08-11-2008, 5:26 PM
    • Posts 5
    • Points 1

    Hi,

     I have developed a website in asp.net and published the webpages and database to the remote server as per the instructions of godaddy help site article. I have also updated the connection string in web config file so that it points to the database on remote server. Site was working fine when I tested on my local site. connection string also works fine on remote server, which is proved by the grid view information displayed on the home page, however when I go to the Login Page and try to login I get the below error message and the same error message when I try to create a new user through the create user control. I have seen few solutions on internet forums and tried them but none of them is working.

    Below is the details of the error message.

     Please let me know if I am doing anything wrong.

    Server Error in '/' Application.

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

    Source Error:

    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): An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800131
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
       System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +737554
       System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +114
       System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +421
       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +133
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
       System.Data.SqlClient.SqlConnection.Open() +111
       System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
       System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197
       System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121
       System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
       System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
       System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83
       System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
       System.Web.UI.WebControls.Login.AttemptLogin() +105
       System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
       System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
       System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433  

     

  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    08-11-2008, 2:47 PM
    • Loading...
    • sugan.v
    • Joined on 06-10-2008, 12:37 AM
    • Posts 185
    • Points 957

    What is ur connectionstring?

    Try this

    <add name="ConnectionString" connectionString="Server=p3swhsql-v17.shr.phx3.secureserver.net;Database=DBName;User ID=UserName;Password=PassWord;Trusted_Connection=False;"/>

    </connectionStrings>

    Also, do you have the Login infomation on the same database? or different database. If you have them in different database, then you will get the error because connectionstring is pointing to the one database right?

     

    -Sugan

    Remember to click “Mark as Answer” on the post If you get answer from this post(s) !
  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    08-11-2008, 3:01 PM
    • Loading...
    • amreddy
    • Joined on 08-11-2008, 5:26 PM
    • Posts 5
    • Points 1

     

    Hi Sugan 

    <
    add name="ConnectionStringASPNET_Users" connectionString="Data Source=p3swhsql-v07.shr.phx3.secureserver.net; Initial Catalog=AAA; User ID=AAA; Password='XXXXXXX';Trusted_Connection=False"

    providerName="System.Data.SqlClient" />

    Above is my connection string which I am using which is similar to yours. This is definetely working as I have used a grid view in my home page using same connection string and it is displaying the right info.

    All the tables are in one database.

    Thanks

     Reddy.

  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    08-11-2008, 4:49 PM
    • Loading...
    • keninnh
    • Joined on 02-23-2008, 6:23 AM
    • Jacksonville, FL
    • Posts 10
    • Points 32

    amreddy;

    Just guessing here, but it looks like your error is happening during login, and that you're using the default .Net Membership provider. Are you sure that your production dataabse includes the tables and sprocs used by .Net (e.g., the aspnet_Membership table)? Also, .net uses its own connection string for this (named LocalSqlServer). On your development machine, it is probably defined in your machine.config; in production you might need to put it into your web.config.

  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    08-11-2008, 6:21 PM
    • Loading...
    • streulich
    • Joined on 11-29-2006, 12:39 AM
    • Los Angeles
    • Posts 5
    • Points 5

     I'm getting the same error. I'm really new to this so I'm not sure of everything you are talking about...

     My connection string is this... connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\EmailCatcher.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;"
     

    Help!

    Sarah

  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    08-11-2008, 10:47 PM
    • Loading...
    • amreddy
    • Joined on 08-11-2008, 5:26 PM
    • Posts 5
    • Points 1

    Where can I exactly find this machine.config file related to my website on my local computer and what information do I need to transfer from that file into my web.config file.

    Full database including all tables, stored procedures, views etc have been published to remote server. I have checked my database on remote server and it contain all the tables, etc that are on my local database. I know I am missing the main point where these user tables , membership tables need to be connected to login control on remote server. I have no clue how to do this because on local machine this is all done by asp.net automatically where login control is connected to sqlexpress aspnetdb database.

  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    08-11-2008, 11:11 PM
    Answer
    • Loading...
    • keninnh
    • Joined on 02-23-2008, 6:23 AM
    • Jacksonville, FL
    • Posts 10
    • Points 32
    machine.config is located here on Vista: C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG. Don't worry about the fact that its in the ASP.net version 2 folder; this is the file used by version 3.0 and 3.5 as well.

     

    machine.config is kind of like web.config, only it is shared across all the websites on a computer. Entries in web.config can override entries in machine.config. By default, your machine.config file contains a connection string named LocalSqlServer that points to a local sqlexpress database that contains the tables and stored procedures .Net relies on for its membership widgets such as the login box. So in your web.config, you might have a connection strings section that looks something like:

        <connectionStrings>
        <remove name="LocalSqlServer"/>
        <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
      </connectionStrings>

    Then, you might copy your sqlexpress file from development to your production server. Or, if you're using Sql Server, you might want to install the tables etc into your sql server database. Here are some instructions:

     http://chrisfulstow.com/blog/post/Configuring-ASPNET-SQL-Server-Providers-in-your-Database.aspx

    These might not be the clearest instructions; if you google around you can find more to choose from.

     If SQL Server isn't your production server of choice, there are versions of the membership database around for MySQL and Access, and probable other dbs as well.


     

  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    08-12-2008, 7:23 PM
    • Loading...
    • amreddy
    • Joined on 08-11-2008, 5:26 PM
    • Posts 5
    • Points 1

    I would like to Thank Kenninh. I have been struggling with this error for last couple of days and looked at loads of forums for an answer and tried few suggestions but none of them worked for me.

    You have pin pointed my error exactly and placing the below code in my web.config file on my remote server did the magic. As you said as I was using my default .Net login controls they were connected through the LocalSqlServer connection string on my local computer system (which is actually in machine.config file) so when i transfered the site to my remote server I could not find this connection string on my web.config file to change.

     <connectionStrings>
        <remove name="LocalSqlServer"/>
        <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
      </connectionStrings>

     

    Thanks once again to Kenninh

  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    10-02-2008, 6:17 PM
    • Loading...
    • nmartin
    • Joined on 09-29-2008, 9:29 PM
    • Posts 18
    • Points 12

    I too have been dealing with this issue. I'm going to try this as soon as I can. Does Go Daddy not have a similar machine.config file on their servers hosting SQL Server as the one on a typical dev machine?? Is this problem typical? It seems to me that this problem would be documented in more places.

     

     

  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    10-02-2008, 6:23 PM
    • Loading...
    • nmartin
    • Joined on 09-29-2008, 9:29 PM
    • Posts 18
    • Points 12

    Almost forgot...

     

    Did you replace the connection string in your web.config with the one from the machine.config or did you just append to the file?

  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    10-03-2008, 11:55 AM
    • Loading...
    • amreddy
    • Joined on 08-11-2008, 5:26 PM
    • Posts 5
    • Points 1

    I have added below script into my web.config file and it worked. You need to replace with your dbname and password

     <connectionStrings>
        <remove name="LocalSqlServer"/>
        <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
      </connectionStrings>

  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    10-03-2008, 2:41 PM
    • Loading...
    • nmartin
    • Joined on 09-29-2008, 9:29 PM
    • Posts 18
    • Points 12

     Are you saying that you replaced ".\sqlexpress" with the name of the server running on your hosting site? This string is just connecting to database file at the root I believe. Did you upload the ASPNET.mdf or did you publish the database to a sql server running at the hosting site?

     I was under the impression you should recreate the database at the server running at the hosting site(typically with a script .sql).

  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    10-05-2008, 12:39 PM
    • Loading...
    • keninnh
    • Joined on 02-23-2008, 6:23 AM
    • Jacksonville, FL
    • Posts 10
    • Points 32

     Someone sent me a provate message, but for whatever reason I'm unable to respond directly.

    Let me take another crack at an explanation. .Net provides a bunch of controls related to allowing user to log in to your site. User IDs, passwords, etc of course have to be stored in a database. By default, .Net provides you with a SQL Express database that contains the necessary information, and a connection string to connect your website with the database. By default the SQL Express database is stored in the App_Data folder of your website, and the connection string is stored in the machine.config file on your development web server (typically your own computer). So what happens is you start using these controls and they work in development, but now you need to deploy them to production.

     In production, you have several different options for where you store the data. One option is to copy the SQL Express database, along with the rest of your website, from dev to prod. This works fine for lots of folks. The only thing is that your prod server might not provide the necessary connection string in their machine.config file. In that situation, you need to provide the connection string in your production web.config file. Typically, simply copying the one from your own machine.config file, as I suggested above, does the trick. However, as amreddy alluded to above, sometimes people change the name or location or security of their SQL Express database, and you may need to alter the connection string as appropriate.

    For various reasons (e.g., for better performance or if your production web server doesn't support SQL Express) you might want to store the data in another database, such as SQL Server, MySQL or even Access. And if you google around you can find articles from people explaining how to do this. In these situations, you again need to provide a connection string in your web.config with the name "LocalSqlServer" that points to whatever data store you've chosen to use.

    HTH

    -Ken

     

  • Re: GoDaddy Login control Error, Server Error in '/' Application. error: 26 - Error Locating Server/Instance Specified

    10-05-2008, 4:24 PM
    • Loading...
    • nmartin
    • Joined on 09-29-2008, 9:29 PM
    • Posts 18
    • Points 12

    Right.. The question is why are we recieving this exception when the asp provider database is recreated at the SQL Server? Go Daddy actually has an ASP schema option when you create your database. Selecting this option actually creates the database with all the appropriate tables, stored procs, etc. So it should work. I get the above exception everytime I attempt to open the applicaition. I actually used a little applicaiton to test that my connection string was actually working and it appears that it is.

     

    -Nick

Page 1 of 1 (14 items)