• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2180
  • Last Modified:

GoDaddy protected page error

I am having the hardest time setting up a simple login page on GoDaddy.  I called GoDaddy and they said I need to set my security level to medium (lots of googling and no solution that I can implement successfully).  I have also setup the SQL Database on GoDaddy, but dont readily see how to add new users.  The tables seem to be setup the same as in the aspnetdb.mdf.  I removed the restrictions for accessing my adduser page (formerly admin only), but I still get the error below.

Here is my web.config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
               
        <add name="aspnetdbConnectionString" connectionString="Data Source=SQLdb.hostedresource.com;Initial Catalog=AppData;Integrated Security=True" providerName="System.Data.SqlClient"/>
    </connectionStrings>

         <system.web>
<customErrors mode="Off"/>
        <authorization>
            <allow roles="admin" />
        </authorization>
        <roleManager enabled="true" />
        <authentication mode="Forms" />
    </system.web>
</configuration>

It works fine on my localhost, but when I publish it I get the following error after I login:
Server Error in '/subdomains/test' 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

Open in new window

0
DemonSquirrel
Asked:
DemonSquirrel
  • 3
  • 2
1 Solution
 
ralmadaCommented:
You are using windows authentication (check your connection string, which contains: Integrated Security=True)
Use SQL authentication instead. Remove Integrated Security=True from your connection string and add user name and password as indicated in this link:
http://msdn.microsoft.com/en-us/library/ms998300.aspx#paght000010_step1 
0
 
DemonSquirrelAuthor Commented:
Here is my connection string.  

I posted a test site www.nw-ark.info/test
You can test it using the following credentials
user: test
pswd: P@ssw0rd

I changed the default settings for the web.config in the config folder to medium and all was working well.  When I posted to GoDaddy is when things started breaking.

I verified that the correct information was in my database on GoDaddy so everything should work...

I also debugged and got the error below.
<add name="ASPNETDBConnectionString" connectionString="Data Source=website.db.1234567.hostedresource.com; Initial Catalog=info; User ID=UID; Password=PWD;"
            providerName="System.Data.SqlClient" />

Open in new window

website-error.jpg
0
 
DemonSquirrelAuthor Commented:
To see the error you will need to click "Login" I guess the admin and user pages are not talking to the login page since they are in a sub directory.
0
 
ralmadaCommented:
Well, this can be caused because of the following:
1) Remote connection is not enabled on Godaddy database server.
2) SQL Browser is not enabled on Godaddy database server. (PAY PARTICULAR ATTENTION TO THIS)
3) The might be a firewall issue.
Please review this ms article and see if it fit your needs:
http://support.microsoft.com/kb/914277 
0
 
DemonSquirrelAuthor Commented:
Please pass this along.   I spent countless hours on this problem with GoDaddy and about a week researching and troubleshooting this issue.

I happened to find the following code and try it.  I kept getting error 500 internal server errors with the sample which had an extra "Trusted_Connection=False" in the asp connection string.

Below is the corrected code:
<configuration>
	<appSettings/>
	<connectionStrings>
<add name="ASPNETDBConnectionString" connectionString=" Data Source=Database.db.1234567.hostedresource.com; Initial Catalog=Database_name; User 
 
ID=Database_user; Password=PASSWORD;" providerName="System.Data.SqlClient" />
 
<remove name="LocalSqlServer"/>
 
<add name="LocalSqlServer" connectionString="
Server=Database.db.4316692.hostedresource.com;
Database=Database_name;
User ID=Database_user;
Password=PASSWORD;
Trusted_Connection=False" providerName="System.Data.SqlClient" />
 
	</connectionStrings>

Open in new window

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now