Microsoft.Data.Sqlite.SqliteException: 'SQLite Error 1: 'no such table: BlogPosts'.' #350
-
|
Can you use When I run with this config I get: |
Beta Was this translation helpful? Give feedback.
Answered by
linkdotnet
Sep 11, 2024
Replies: 1 comment 1 reply
-
|
Yes that works. {
"PersistenceProvider": "Sqlite",
"ConnectionString": "Data Source=my.db",You could also remove |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
digitaldirk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes that works.
What is your connection string inside the appsettings.json? If you have something like:
{ "PersistenceProvider": "Sqlite", "ConnectionString": "Data Source=my.db",You could also remove
my.dbor rename it tomy.db.oldso that Sqlite will create a new one from scratch.BlogDbContextdoes callDatabase.EnsureCreated();if the database doesn't exist.