Created
March 5, 2013 05:54
-
-
Save timheuer/5088325 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed partial class MainPage : Page | |
{ | |
public MainPage() | |
{ | |
this.InitializeComponent(); | |
Loaded += MainPage_Loaded; | |
} | |
void MainPage_Loaded(object sender, RoutedEventArgs e) | |
{ | |
var path = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "foo.db"); | |
using (var db = new SQLiteConnection(path, true)) | |
{ | |
db.DropTable<Person>(); | |
db.CreateTable<Person>(); | |
db.Insert(new Person() { FirstName = "Tim", LastName = "Heuer" }); | |
db.Insert(new Person() { FirstName = "Zane", LastName = "Heuer" }); | |
} | |
} | |
} | |
public class Person | |
{ | |
[PrimaryKey,AutoIncrement] | |
public int ID { get; set; } | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment