The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
Using .sqlite3 file to create a database on Windows Phone 8 RRS feed

  • Question

  • I've been trying out SQLite on windows phone using this tutorial as basehttp://code.msdn.microsoft.com/wpapps/Using-Sqlite-with-WP8-52c3c671 and in it, the Database is created in the App.xaml with this

    string dbPath = Path.Combine(
        Windows.Storage.ApplicationData.Current.LocalFolder.Path,
        "db.sqlite"); 
    if (!FileExists("db.sqlite").Result) 
    { 
        using (var db = new SQLiteConnection(dbPath)) 
        { 
            db.CreateTable<Person>(); 
        } 
    }
    
    private async Task<bool> FileExists(string fileName) 
    { 
        var result = false; 
        try 
        { 
            var store = await Windows
                .Storage.ApplicationData.Current.LocalFolder
                .GetFileAsync(fileName); 
            result =true; 
        } 
        catch { }
        return result; 
    }

    I have a database.sqlite3 file with a database I created, how i can use that file to create the database on my windows phone app ?

    Friday, January 31, 2014 4:02 PM

All replies