Application not able to connect to SQL Server

  • I recieved the error message below from the application when tried connecting to the database using the credentials.

    Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

    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. The login is from an untrusted domain and cannot be used with Windows authentication.

    1. I verified the firewall it allows the port.

    2. I verified the user, and is able to connect to the server using the SQL CLient.

    3. I have verified the server and it doesn't have the Windows authentication on it is has Mixed mode checked. I verified user credentials using the sql server authentication and it works for me but the application is not able to access.

    Please suggest as the application has to be live ASAP.

    Thanks,

    Swetha K

  • Your application is using a connection string for windows authentication and, as the error says, the domains aren't trusted.

    Either ask the domain admin to set up the required trust between domains or change the application's connection string to use SQL authentication. It's not the server that decides if an app is using SQL or windows authen, it's the application, specifically the settings in the connection string.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • swethak13 (9/21/2010)


    I recieved the error message below from the application when tried connecting to the database using the credentials.

    Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

    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. The login is from an untrusted domain and cannot be used with Windows authentication.

    1. I verified the firewall it allows the port.

    2. I verified the user, and is able to connect to the server using the SQL CLient.

    3. I have verified the server and it doesn't have the Windows authentication on it is has Mixed mode checked. I verified user credentials using the sql server authentication and it works for me but the application is not able to access.

    Please suggest as the application has to be live ASAP.

    Thanks,

    Swetha K

    I think you should discuss this with your network administrator. Reread the underlined sentence in the error message.

    Edit: oops. While I was typing, Gail posted her version of what I meant to say.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • I discussed it with the network admin but, they say as it is connected to the port 1433 there shouldn't be an issue as we have another application from the same server which is working with no issues.

    I have tried again and I recieve this message:"The login is from an untrusted domain and cannot be used with Windows authentication."

    Do I have change any settings as different user is able to connect to the same server but different database.

    Thanks,

    Swetha K

  • GilaMonster (9/21/2010)


    Your application is using a connection string for windows authentication and, as the error says, the domains aren't trusted.

    Either ask the domain admin to set up the required trust between domains or change the application's connection string to use SQL authentication. It's not the server that decides if an app is using SQL or windows authen, it's the application, specifically the settings in the connection string.

    Port 1433 open just allows connectivity. You have a connection, but the login is failing. It is not a port or network protocol error. It is because the application is using windows authentication (trusted_connection = true) where there is no trust relationship.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I have verified the user permissions I have replicated exactly with user credentials that work with different application.

    Have verified the connection string of an IIS server also ...

    connectionString="data source=IP address,1433;Integrated Security=SSPI;Initial Catalog=DBName;uid=User id ;password=password

    Am I missing any please suggest.

    Thanks,

    Swetha K

  • swethak13 (9/21/2010)


    connectionString="data source=IP address,1433;Integrated Security=SSPI;Initial Catalog=DBName;uid=User id ;password=password

    Remove the highlighted portion. Integrated = windows, not SQL authent.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You can choose Windows authentication (using what the user logged into the Windows host with, no name/pwd needed) or SQL Authentication (using a name/password provided in the connection string).

    You can't do an either or, and so if your domain is not trusted and you want to use the user name and password, remove the section Gail mentioned.

    Auth modes: http://msdn.microsoft.com/en-us/library/aa905171%28SQL.80%29.aspx

    Connection Strings: http://www.connectionstrings.com/sql-server-2008

  • Hi Gail, thank you it worked for me after removing the security. I ensured this with the network they sid their is a trusted connection between the servers, and asked me to check if I have to enable any in the SQL server to ensure it is trusted connection.

    Do we have any??

    Once again thank you very much.

    Swetha K

  • swethak13 (9/21/2010)


    Hi Gail, thank you it worked for me after removing the security. I ensured this with the network they sid their is a trusted connection between the servers, and asked me to check if I have to enable any in the SQL server to ensure it is trusted connection.

    Are the two servers in the same domain?

    If not, is there a trust relationship between the domains? (not a trusted connection, a trust relationship)

    I think that connection string was malformed for either option.

    For windows authentication (trusted connection) your connection string should read like this:

    "Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;"

    or

    "Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;"

    For SQL authentication your connection string should read like this:

    "Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;"

    Decide which you should be using, check out the links Steve provided, then make sure that your connection string is correct.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply