C#C
C#2y ago
kevin

Trying to implement SQL database in my app

Hello I'm trying to implement SQLite in my application, my professor has provided me with sample code but whenever i try to implement it i get the error seen in the screenshot, i suppose the package cant find my database file ?

Heres the code im using:

Constants.cs
    public static class Constants
    {
        private const string dBFileName = "database.db3";

        public const SQLiteOpenFlags flags =
            SQLiteOpenFlags.ReadWrite |
            SQLiteOpenFlags.Create |
            SQLiteOpenFlags.SharedCache;

        public static string DatabasePath
        {
            get
            {
                Console.WriteLine(FileSystem.AppDataDirectory, dBFileName);
                return Path.Combine(FileSystem.AppDataDirectory, dBFileName);
            }
        }
    }
Was this page helpful?