Cannot connect to Sql Server from Visual Studio (in the process of creating a new Entity Data Model): login failed for user 'sa'

database-connection entity-framework-6 sql-server-2016 visual-studio-2017

Question

I know there are similar questions, but I have a specific problem.

Microsoft Visual Studio (2017) pops up this error when I try to create a DB connection for my Entity Data Model

The attempt to attach to the database failed with the following information: Login failed for user 'sa'.

enter image description here

What I've already checked:

1) The sa user's password hasn't expired or isn't different than what I have specified.

2) The sa user has not been disabled, either by being denied permission to connect to the database engine nor having the login disabled.

3) My instance of SQL Server 2016 (Developer Edition) is configured for SQL authentication.

4) SQL Server is running and I also can connect to it by SQL Server Management Studio (v17.1) via sa and Windows Authentication as well.


What the problem could be?


UPDATE:

I tried to create a DB connection, when adding ADO.NET Entity Data Model -> EF Designer from database -> New Connection -> Microsoft SQL Server Database File (the SchoolDB.mdf wasn't attached to SQL Server... maybe this is the source of the problem)

1
0
6/29/2017 6:46:48 AM

Accepted Answer

To be honest, I tried to carry out the same action (make a connection to database (SchoolDB.mdf) and attach the SchoolDB.mdf file to SQL Server), and then Visual Studio gave me a hint:

The database file that you are attempting to connect is not compatible with the current instance of SQL Server.

enter image description here

Then VS suggested me to upgrade the database file (SchoolDB.mdf).

enter image description here

After I'd done an upgrade of the *.mdf file (that I was trying to attach to SQL Server and make a connection to this DB after that), I could establish a connection to this database (already attached to SQL Server).

Screenshot

PS: I found out that SchoolDB.mdf was created by SQL Server 2012, while I tried to connect it to SQL Server 2016.

1
6/29/2017 6:41:03 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow