Get file path for Windows Phone?

Hi,

I used the below for Android Project to get a file path for my DB file. How would I do this for Windows Phone 8 Project?

string dbPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "db_file");

Answers

  • SilverSurferSilverSurfer USMember ✭✭

    Found it!

    Windows.Storage.ApplicationData.Current.LocalFolder.Path

  • SilverSurferSilverSurfer USMember ✭✭

    Here's the final code:

            string dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "test");
    
            connection = new SQLiteConnection(new SQLitePlatformWinRT(), dbPath);
    

    It appears SQLite.net-pcl doesn't work with Windows Phone 8. I thought it should be compatible. Below is the error messages.

    An exception of type 'System.DllNotFoundException' occurred in SQLite.Net.Platform.WinRT.DLL but was not handled in user code

    Additional information: Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Sign In or Register to comment.