T
T
theBoris342020-11-22 13:24:49
.NET
theBoris34, 2020-11-22 13:24:49

Problem with Entity Framework. Can't get data from database. What to do?

I created a database, filled it with test data, but I can't work with them.

When the application tries to load data from the database, I get an exception:
"Microsoft.Data.SqlClient.SqlException: "Cannot open database "Database.db" requested by the login. The login failed.
Login failed for user 'DESKTOP\User'."

Before connecting from the application, made database migrations (add-Migration; update-Database)

Connection string: "Data Source=(localdb)\\mssqllocaldb;Initial Catalog=Database.db;Integrated Security =SSPI"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NonameProgrammer, 2020-11-22
@NonameProgrammer

Install via Nuget SqlServer. Remove .db after Database. Should help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question