0

I'm developing a Winform project that needs to connect to a remote Sql server. I'm using Entity Framework as ORM. Here is my connectionstring

<add name="RemoteConnection" connectionString="Data Source=*****;Initial Catalog=****;User Id=****;Password=*****;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />

I get the following error when i want to connect remote sql server

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

Everything works fine with SQL server management studio, i'm able to see databases and have access to them, but when in comes to code i get error

1
  • 1
    You have chose Windows authentication while adding entity model, instead select SQL Server Authentication. Commented Nov 6, 2017 at 12:03

1 Answer 1

2

User Id=****;Password=*****;Integrated Security=True

is wrong. If you want to use Integrated security, you should not pass any credential (leave only Integrated security= True).

If instead you want to use SQL Server login (+ password), pass only them and exclude Integrated security= True

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.