public class Person
{
[PrimaryKey]
[AutoIncrement]
public int ID
{
get;
set;
}
public string Name
{
get;
set;
}
public int Age
{
get;
set;
}
}

 

????????"PrimaryKey"????????????????????????????“AutoIncrement”????????????????С?
????12.????Person???

 

/// <summary>
/// ????Person??
/// </summary>
/// <returns></returns>
private async Task<SQLiteAsyncConnection> CreatePersonTableAsync()
{
var conn = new SQLiteAsyncConnection(localDBPath);
await conn.CreateTableAsync<Person>();
return conn;
}

 

????localDBPath????????????·????
???????????????????“SQLiteAsyncConnection”??????Person?????????????????
????13.????????????????????????????д?????????????????

 

private async void AddData_Tapped(object sender?? TappedRoutedEventArgs e)
{
//????Person????
Person person = new Person();
person.Name = textboxName.Text;
person.Age = int.Parse(textboxAge.Text);
//?????????
var conn = await CreatePersonTableAsync();
await conn.InsertAsync(person);
}

 

?????????????CreateTableAsync????????????????е?Table??
???????
???????????????????Щ??????????WP8.1?????Sqlite??????????????
?????????????????????ж??Щ??????????????????????????????????????????????????
???????????????????????????о??????“SQLiteAsync”??????5?????????????????SQLiteAsync????Щ???顣