0
在這裏,在Windows 8中SQLLite數據庫的我的插入代碼,我想更新其在數據庫中添加更新數據庫記錄在SqlLite數據庫
private async void insert(object sender, RoutedEventArgs e) {
if (txt1.Text != "" && txt2.Text != "" && txt3.Text != "") {
var dbpath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "data.db3");
using (var db = new SQLite.SQLiteConnection(dbpath)) {
// Create the tables if they don't exist
db.Insert(new person() {
id= Guid.NewGuid(),
name = txt1.Text.ToString(),
address = txt2.Text.ToString(),
phone = Convert.ToDouble(txt3.Text.ToString()),
});
db.Commit();
db.Dispose();
db.Close();
}
} else {
throw new NullReferenceException("Enter The Data In Textboxes");
}
}