Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Discussion in 'ASP.NET 2.0' started by Stanfield, Aug 6, 2006.

  1. H E L P !!!!

    Appears I either have a problem with my "code" or there is a problem with how SQL Server 2005 is setup. It's probably something I need to change in my web.config or elsewhere.

    Will someone assist me with understanding what is going on and what I need to "fix it".....?

    Ticket Details
    Ticket #: 410517
    Department: Support
    Status: Open
    Subject: Login failed for user ''.
    From: [email protected]
    8/6/2006 12:59:43 PM
    Ref ticket 410197.
    After changing the web.config to turn OFF custom errors, I received the following error message:
    -->
    Login failed for user ''. The user is not associated with a trusted SQL Server connection.
    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: Login failed for user ''. The user is not associated with a trusted SQL Server connection.
    <--
    I searched Google and found this page:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;555332 which states:
    -->
    CAUSE
    The SQL server has been configured to operate in "Windows Authentication Mode (Windows Authentication)" and doesn't allow the use of SQL accounts.
    <--
    So where is the configuration problem? My web.config or your settings in SQL Server 2005?
    I will post all of this to the forum. Maybe someone there knows what is going on.
    Thanks!
    Jim Stanfield
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    this looks like a connection string problem


    can you post your connection string? (please do not post the login/password)


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Jim,
    This sounds like a SQL Server configuration issue. I had the same problem, and it was because my server was using "Windows Authentication" for logging in. I had to change the server properties to use SQL Server Authentication. Basically, the difference is that with Windows Authentication, SQL server "trusts" that the person currentlylogged into windows is also allowed to access the SQL data. In SQL Server Authentication, it doesn't matter who is logged into windows, because the validation takes place through SQL Server. For the latter, you need to have at least one user set up in SQL Server so that they can log in, or use the built in 'sa' account.

    Hope this helps.
    Dan
     
  4. Jim,


    Wow, this is really a problem. I know for sure that DiscountASP's SQLServer 2005 implementation allows SQL accounts, since mine works. I would open up the properties of your database (in SQL Server Manager, right click on your database and select "properties").


    Look for anything in there that points to using Windows Authentication. You don't want windows authentication, but there may be some flag or something somewhere saying that your particular database is using it. You need SQL Server Authentication.


    Sorry you're having trouble. Been there many times.


    PharmaPAC
     
  5. <connectionStrings>





    <remove name="LocalSqlServer"/>


    <add name="Personal" connectionString="Data Source=sql2k503.discountasp.net;


    Integrated Security=false;


    User Instance=True;


    User ID=SQL2005_262175_xxxxxxx_user;


    Password=*********


    AttachDBFilename=SQL2005_262175_yyyyyyy"


    providerName="System.Data.SqlClient"/>


    <add name="PersonalConnectionString1" connectionString="Data Source=sql2k503.discountasp.net;


    AttachDbFilename=SQL2005_262175_yyyyyy;


    Integrated Security=false; User Instance=True


    User ID=SQL2005_262175_xxxxxxx_user;


    Password=*********"


    providerName="System.Data.SqlClient"/>


    <add name="LocalSqlServer" connectionString="Data Source=sql2k503.discountasp.net;


    Integrated Security=false;


    Initial Catalog=SQL2005_262175_yyyyyyy; User Instance=True


    User ID=SQL2005_262175_xxxxxxx_user;


    Password=********"


    providerName="System.Data.SqlClient" />


    </connectionStrings>
     
  6. I am switching hosting companies.


    I just hope I can get a refund for the annual monies paid to discountasp.net.


    I simply needed more assistance than this company is able to give.


    Best wishes for a better future to all concerned.





    Respectfully,


    Jim Stanfield
     
  7. I don't know if this makes a difference for you, but here is my connection string:


     
  8. Thanks for the suggestions! I incorporated tcp: and changed to 504 in the data source and removed user instance. After uploading the revised web.config, the same result - login failed.
     
  9. Bruce

    Bruce DiscountASP.NET Staff

    Good luck, Jim.


    Sorry we can't help you resolve your issue.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  10. Jim,

    Your ticket was on 8/6, and you decided to leave on 8/10. That's not a lot of patience or flexibility. DASP folks have a business to run, and with all due respect, we all need to take the bull by the horns to solve our issues. That's why I was working with you, one user to another. Joe Citizen. Personally, I'm dissappointed because I always love a challenge, and your problem was perplexing. We would have figured it out eventually. I looked forward to fixing it with you.

    Unless your issue is actually losing you revenue that pays the rent and feeds your kids, it's not worth throwing in the towel. If that IS the case, state that in the support ticket, and perhaps it gets prioritized.

    yours,

    PharmaPAC
     

Share This Page