Connecting SqliteDB via appsetting.json file triggers 'Data Source cannot be empty. Use :memory: to open an in-memory database'

Viewed 55

I am trying to connecting my web application to a SQLite db via an appsetting.json file.

This is my appsetting.json file

 {
  "ConnectionStrings": {
    "SqlDb": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=HotelAppDB;Integrated Security=True;Connect Timeout=60;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    "SqliteDb": "‪Data Source=C:\\Users\\Daniel\\Desktop\\HotelAppDB.db;Version=3;"
  },
  "DatabaseChoice": "SQLite"
}

Please ignore the "SqlDb" connection, which is working at the moment. However, when I tested my SqliteDb connectionstring. VS return an error as follow:

enter image description here

The Sqlite database is sitting at my desktop, as followed

enter image description here

I put a breakpoint in my code, the local windows indicate the application actually got the location of my sqlite db. enter image description here How to dissolve this issue? Thanks in advance.

0 Answers
Related