C#C
C#2y ago
ApathyErr

✅ sqlite local db file

For some reason, sqlite works only when the full path to the database is specified.
Like:
"Data Source= E:\\VS Projects\\ProfitCalculator\\ProfitCalculator\\DataBase\\Profit Calculator DataBase.db"

The code that accesses the database is located in another ViewModel folder

How do I specify the local path to the database?

And it doesn't work like that:
optionsBuilder.UseSqlite("Data Source=\\DataBase\\ProfitCalculatorDataBase.db");


And that too:
optionsBuilder.UseSqlite("Data Source=" + System.AppContext.BaseDirectory + "\\DataBase\\ProfitCalculatorDataBase.db");
Was this page helpful?