Connection String Error message -- with a twist

Discussion in 'Databases' started by securepagel, Sep 29, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi All,

    Sorry in advance for the wall of text, but I want to provide a complete background to this issue.

    I'm still trying to get my existing code (formerly hosted at another provider) to play nicely with the DiscountASP settings. I'm experiencing an issue that others have had in the past, but I think I have a unique twist. I will explain my problem first, and if you guys need me to provide my code, I will be happy to do so.

    I have a login page on my website (which uses a login control that I've done custom modifications to) which checks a username and password against the SQL 2008 R2 database I purchased from DiscountASP. The problem I'm having is that it allows a successful username/password match to log in without difficulty. That indicates to me that my database is SUCCESSFULLY connecting when the password is correct. However, if you type an incorrect password in, it throws up this 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)

    I can't understand why it can successfully connect if the user's password in the database is correct, but not connect if the user's password is incorrect?

    Any ideas? I'll note that I tried adding connection string code to my web.config file that I found elsewhere on this forum, but that resulted in different errors.

    Thanks!
     
  2. Is there maybe a different connection string somewhere else that your app is falling back on? When you get the .net sql error, is the path of the web.config the correct one? This way you can check if it's looking at the correct web.config, or maybe it's looking at another one (perhaps subdirectory?).
     
  3. Well, my login.aspx page is in the root directory, as is my web.config. I don't typically put any connection strings in my web.config, and I've never had issues with not doing so before. I always just Dim an instance of the connection string whenever I need it in my code...

    I did try the code in another thread on this subject to remove and re-add the LocalSqlServer with my connection string in my web.config, but that gets me this error:

    Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

    The code I'm using doesn't refer to any stored procedures...?

    I just can't imagine why my code connects me in all other instances except in the invalid password?

    Thanks again.
     
  4. When your users enter the correct combination of password and nick it works. Have you try debugging it? To see where does it go when the user name and password do not match? May be you need to call a function that takes the user to a "sorry your username and password do not match".
     
  5. Yes, we have this exact same site installed at another hosting provider (who we are currently switching away from) and it works fine. We moved over identical code and database name, users and tables to DiscountASP, and updated only the connection strings in the code (so that it can connect to DiscountASP's SQL instead of our old provider's SQL).

    This same code is still up and running beautifully at the old provider. So, the first thing I am asking is what exactly is so different about DASP's environment that is causing this to happen. It has to be the environment since the code works elsewhere.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page