Create and use local database in monomac project

TimLTimL SZMember

In my monomac project build in xamarin studio, I need to use database. It has to be local, stored in single file database.
I have to say I always used Volante database (it was for Windows) for such a purpose. I do have a problem with running that project on mac though.

I basically do:

        IDatabase db = DatabaseFactory.CreateDatabase();

        string folder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "/Test/";
        string file = folder + "myname.db";

        // Up here I checked if folder exists, if file exists, if I have rights to open, execute them. I do.
        // Also here I tried to File.WriteAllText(file , "Write this text into a file"); - and it worked. So file exists and is healthy
        db.Open (file);

And at db.Open I get this exception:

e {System.EntryPointNotFoundException: FlushFileBuffers at (wrapper managed-to-native) Volante.OsFile:FlushFileBuffers (Microsoft.Win32.SafeHandles.SafeFileHandle) at Volante.OsFile.Sync () [0x0001e] in :0 at Volante.Impl.PagePool.flush () [0x00085] in :0 at Volante.Impl.DatabaseImpl.Open (IFile file, Int32 cacheSizeInBytes) [0x004ee] in :0 at Volante.Impl.DatabaseImpl.Open (System.String filePath, Int32 cacheSizeInBytes) [0x00007] in :0 at Volante.Impl.DatabaseImpl.Open (System.String filePath) [0x00000] in :0 at ......

Do you have any suggestions, what might that be? Thanks for any help

Best Answer


Sign In or Register to comment.