??Windows Phone 8.1?????Sqlite?????
???????????? ???????[ 2015/1/22 13:34:30 ] ????????Sqlite ?????
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????Щ???顣
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11