G
G
Georgy Kuznetsov2021-11-18 13:46:32
C++ / C#
Georgy Kuznetsov, 2021-11-18 13:46:32

Where is the database stored when using EF Core under SQL Server?

Let's say in the context for the database there is such a method:

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlServer("Server=(localdb)\\mssqllocaldb;Database=database_01;Trusted_Connection=True;");
        }


Where, based on this record, the file itself from the database can be saved and what other additional information is needed?

PS There is no database file in the folder with the executable itself

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-11-18
@JoeSmith3100

The *.mdf file with the base must be in the user's local folder.
C:\Users\%USERNAME%\database_01.mdf
or:
C:\Users\%USERNAME%\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\MSSQLLocalDB
https://stackoverflow.com/a/36297648/ 14163502

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question