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

    Question

  • I am a home user and new to C# Express 2010 and SQL Server R2 2008.

    I have been writing some programs and some databases and it works very well on my computer.

    Just for fun I wanted to try to

    -          Publish the programs with C#

    -          Put it in a Web-hotel where I have a domain

    -          Try to load run it from different computers through the Internet.

    -          The program works well in development computer when I load it through Internet but not anywhere else.

     

    I get the message regarding SQL SERVER

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

     

    I read all I could find on Internet about this and tried to make adjustments so it would work but it does not (spent lots of hours on this). It seems that MS made this very hard for a newbie.

     

    This is my settings now: Data Source=XXXX-PC\SQLEXPRESS;Initial Catalog=V2_Horses;Integrated Security=True; Connect Timeout=30

    I have tried to remove Integrated; used SSPI; user and so on but no luck.

     

    Server is set to SQL server and …

     

    Services are like this started, Automtic and Local Sysrem

     

    I have tried changing Local system to Network for services

     

    I have enabled all protocols except VIA (TCP…)

     

    I have tried without Firewall

    I have put in port 1433 in Inbound rules and 1434 in 1434 in Outbound rules

    sqlservr.exe and sqlbrowser.exe in allowed programs and so on.

     

    I read all I could find on Internet about this and tried to make adjustments so it would work but it does not (spent lots of hours on this). It seems that MS made this very hard for a newbie and I hope there is someone out there that could give me some hints.

     

    I am using Windows7 and to C# Express 2010 and SQL Server R2 2008


    Thursday, June 30, 2011 2:12 PM

Answers

  • Hi

    Three ways:

    1. Use the SQL Authentication to login to the SQL Server.

    You can get this done by changing the connection string to use SQL authentication while connecting. But you need to know the credentials of an account which is having permissions to your required database or the System Administrator (SA) password. For simplicity I will use SA account details in the connection string.





    1. <connectionStrings>
    2.   <add name="cnnStr" providerName="System.Data.OleDb" connectionString="Data Source=BI-SVR;Persist Security Info=True;Password=YourPassword;User ID=sa;Initial Catalog=BBIDatabase"/>
    3. </connectionStrings>

     

    2. Login to your machine using the same Domain.

    If you login to your machine using a domain account which the SQL Server is added to, then this error will vanish. But for this you need to add your machine to the same domain which the SQL Server machine is added to (CompanyDomain) also to properly get authenticated the account used should have proper permissions set to access the database in the SQL Server.

    3. Make the account trusted in SQL Server.

    By making the account you use to login to your machine trusted account in SQL Server and giving it appropriate permissions to access databases will also permit you to fix this error.

    http://arjunachith.blogspot.com/2010/05/failed-login-is-from-untrusted-domain.html

    Hope it helps.

     


     

    Cookie Luo[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

     

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    Thanks for you answer, but I won't use my solution since it's to dangerous to use = other people directly into your computer by Internet. I will try to make a WebService to retrive the information.
    NIsseO
    • Marked as answer by NisseO Tuesday, July 05, 2011 9:17 AM
    Monday, July 04, 2011 8:08 AM

All replies

  • Hi

    Three ways:

    1. Use the SQL Authentication to login to the SQL Server.

    You can get this done by changing the connection string to use SQL authentication while connecting. But you need to know the credentials of an account which is having permissions to your required database or the System Administrator (SA) password. For simplicity I will use SA account details in the connection string.





    1. <connectionStrings>
    2.   <add name="cnnStr" providerName="System.Data.OleDb" connectionString="Data Source=BI-SVR;Persist Security Info=True;Password=YourPassword;User ID=sa;Initial Catalog=BBIDatabase"/>
    3. </connectionStrings>

     

    2. Login to your machine using the same Domain.

    If you login to your machine using a domain account which the SQL Server is added to, then this error will vanish. But for this you need to add your machine to the same domain which the SQL Server machine is added to (CompanyDomain) also to properly get authenticated the account used should have proper permissions set to access the database in the SQL Server.

    3. Make the account trusted in SQL Server.

    By making the account you use to login to your machine trusted account in SQL Server and giving it appropriate permissions to access databases will also permit you to fix this error.

    http://arjunachith.blogspot.com/2010/05/failed-login-is-from-untrusted-domain.html

    Hope it helps.


    Cookie Luo[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

     

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Monday, July 04, 2011 7:18 AM
  • Hi

    Three ways:

    1. Use the SQL Authentication to login to the SQL Server.

    You can get this done by changing the connection string to use SQL authentication while connecting. But you need to know the credentials of an account which is having permissions to your required database or the System Administrator (SA) password. For simplicity I will use SA account details in the connection string.





    1. <connectionStrings>
    2.   <add name="cnnStr" providerName="System.Data.OleDb" connectionString="Data Source=BI-SVR;Persist Security Info=True;Password=YourPassword;User ID=sa;Initial Catalog=BBIDatabase"/>
    3. </connectionStrings>

     

    2. Login to your machine using the same Domain.

    If you login to your machine using a domain account which the SQL Server is added to, then this error will vanish. But for this you need to add your machine to the same domain which the SQL Server machine is added to (CompanyDomain) also to properly get authenticated the account used should have proper permissions set to access the database in the SQL Server.

    3. Make the account trusted in SQL Server.

    By making the account you use to login to your machine trusted account in SQL Server and giving it appropriate permissions to access databases will also permit you to fix this error.

    http://arjunachith.blogspot.com/2010/05/failed-login-is-from-untrusted-domain.html

    Hope it helps.

     


     

    Cookie Luo[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

     

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    Thanks for you answer, but I won't use my solution since it's to dangerous to use = other people directly into your computer by Internet. I will try to make a WebService to retrive the information.
    NIsseO
    • Marked as answer by NisseO Tuesday, July 05, 2011 9:17 AM
    Monday, July 04, 2011 8:08 AM