I want to connect from EntityFrameworkCore to sqlite3 database but don't know how to obtain connection string...

Juan Dent 236 Reputation points
2022-08-24T18:11:23.76+00:00

I have created a console project for C# and installed the following packages:

Microsoft.EntityFrameworkCore.Sqlite
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.Tools

I have a sqlite3 database at a path c:\Data\db.sqlite

How can I connect to this database (in particular what is the connection string?) and how can I reverse engineer the database into my C# project? (i.e. creation of DbContext and models)

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,329 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,607 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Juan Dent 236 Reputation points
    2022-08-24T19:07:01.823+00:00

    the connection string is simply: "Data Source=c:\Data\SeguroMedicoMFC.sqlite;"

    0 comments No comments