The error above occurred while learning Entity Framework Core to use SQLite because the DB file could not be found.
Add the specific DB file path in UseSqlite(“”) : change to the following:
Add the specific DB file path in UseSqlite(“”) : change to the following:
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlite(@"Data Source=E:\alexander\code\sqlite\EFGetStarted\blogging.db");
public class BloggingContext : DbContext
{
public DbSet<Blog> Blogs { get; set; }
public DbSet<Post> Posts { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlite(@"Data Source=blogging.db");
}
public class Blog
{
public int BlogId { get; set; }
public string Url { get; set; }
public List<Post> Posts { get; } = new List<Post>();
}
public class Post
{
public int PostId { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public int BlogId { get; set; }
public Blog Blog { get; set; }
}
Read More:
- python sqlite Error IntegrityError: UNIQUE constraint failed: table_area1.user_name
- An error occurred when opensips started the service“ ERROR:core :db_ check_ table_ Version: invalid version 7 for Table dialog found “
- Error 1146 (42s02): table ‘database name. Table name’ doesn’t exist ‘
- Insufficient table space ORA-00604 unable to extend table SYS.AUD by 8192
- Error no module named ‘in newly installed Python_ sqlite3‘
- configure: error: Package requirements (sqlite3 」 3.7.4) were not met:
- Unknown error (SQLite code 14): could not open database (How to Fix)
- (element UI component table) how to add a style to a table
- 1093 – You can’t specify target table ‘table’ for update in FROM clause
- Errors in IntelliJ ieeasql statements and table names in @ table
- Pit encountered by entity class data type BigDecimal
- yum install/update error: sqlite3.DatabaseError: database disk image is malformed
- C programming interface of SQLite database (6) result codes and error codes
- sqlite3.OperationalError: no such column:
- android.database.sqlite.SQLiteException: near “where”: syntax error (code 1): ,
- Error in idea @ data entity class get / set
- Nginx upload error 413 request entity too large
- Permission denied error: unable to index file .vs/Trip2015/v15/Server/sqlite3/db.lock fatal: adding
- In SQLite database, set the default value for the field as the current time
- QuartusII software exception: error: top level design entity “” is undefined