Skip to content

Instantly share code, notes, and snippets.

@timheuer
Created March 5, 2013 05:54
Show Gist options
  • Save timheuer/5088325 to your computer and use it in GitHub Desktop.
Save timheuer/5088325 to your computer and use it in GitHub Desktop.
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