locked
Error while running the published website on IIS 7.5 RRS feed

  • Question

  • I have an asp.net website which is developed in asp.net 4.0 with data binding from a database which is maintain in sql server 2000.. It it working fine on localhost but when I am deploying it on IIS 7.5 and while running the page following error is occurring..

    Login failed for user 'testuser'. Reason: 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.OleDb.OleDbException: Login failed for user 'testuser'. Reason: Not associated with a trusted SQL Server connection.

    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.

    • I am using mixed mode authentication and sql server 2008 is installed on my system
    • I am using the following connection string in my .cs page

    using (OleDbConnection con3 = new OleDbConnection("Provider=SQLOLEDB;Data Source=sbs;User ID=testuser;Passwrd=pinkCITY01;Initial Catalog=PCGnet"))

    Tuesday, April 9, 2013 12:41 PM

Answers

  • Have you restarted SQL instance after changing to mixed authentication mode?

    This problem occurs if the user tries to log in with credentials that cannot be validated. This problem can occur in the following scenarios: 
    • Scenario 1: The login may be a SQL Server login but the server only accepts Windows Authentication.
    • Scenario 2: You are trying to connect by using SQL Server Authentication but the login used does not exist on SQL Server.
    • Scenario 3: The login may use Windows Authentication but the login is an unrecognized Windows principal. An unrecognized Windows principal means that Windows can't verify the login. This might be because the Windows login is from an untrusted domain.

    http://support.microsoft.com/kb/555332

    Tuesday, April 9, 2013 12:47 PM

All replies

  • Have you restarted SQL instance after changing to mixed authentication mode?

    This problem occurs if the user tries to log in with credentials that cannot be validated. This problem can occur in the following scenarios: 
    • Scenario 1: The login may be a SQL Server login but the server only accepts Windows Authentication.
    • Scenario 2: You are trying to connect by using SQL Server Authentication but the login used does not exist on SQL Server.
    • Scenario 3: The login may use Windows Authentication but the login is an unrecognized Windows principal. An unrecognized Windows principal means that Windows can't verify the login. This might be because the Windows login is from an untrusted domain.

    http://support.microsoft.com/kb/555332

    Tuesday, April 9, 2013 12:47 PM
  • Hi there,

    I think the problem in the IIS settings.

    As you able to access from local server i believe that your user have enough permissions. please cross check from SSMS.

    make a new post in .net forums to get more help.

    Cheers

    Kumar

    Wednesday, April 10, 2013 4:25 AM