C
C#9mo 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"
"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");
optionsBuilder.UseSqlite("Data Source=\\DataBase\\ProfitCalculatorDataBase.db");
And that too:
optionsBuilder.UseSqlite("Data Source=" + System.AppContext.BaseDirectory + "\\DataBase\\ProfitCalculatorDataBase.db");
optionsBuilder.UseSqlite("Data Source=" + System.AppContext.BaseDirectory + "\\DataBase\\ProfitCalculatorDataBase.db");
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server