Skip to content

Microsoft.Data.Sqlite.SqliteException: 'SQLite Error 1: 'no such table: BlogPosts'.' #350

Closed Answered by linkdotnet
digitaldirk asked this question in Q&A
Discussion options

You must be logged in to vote

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.db or rename it to my.db.old so that Sqlite will create a new one from scratch.
BlogDbContext does call Database.EnsureCreated(); if the database doesn't exist.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@digitaldirk
Comment options

Answer selected by digitaldirk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants