using (SQLiteConnection connection = new SQLiteConnection("Data Source=test.db"))
{
connection.Open();
using (SQLiteTransaction tran = connection.BeginTransaction())
{
using (SQLiteCommand cmd = connection.CreateCommand())
{
cmd.CommandText = "DELETE FROM test_tbl WHERE id=@id";
cmd.Parameters.Add("@id", DbType.UInt32);
cmd.Parameters[0].Value = id;
cmd.Prepare();
cmd.ExecuteNonQuery();
}
tran.Commit();
}
}
ICAgICAgICAgICAgdXNpbmcgKFNRTGl0ZUNvbm5lY3Rpb24gY29ubmVjdGlvbiA9IG5ldyBTUUxpdGVDb25uZWN0aW9uKCJEYXRhIFNvdXJjZT10ZXN0LmRiIikpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uT3BlbigpOwogICAgICAgICAgICAgICAgdXNpbmcgKFNRTGl0ZVRyYW5zYWN0aW9uIHRyYW4gPSBjb25uZWN0aW9uLkJlZ2luVHJhbnNhY3Rpb24oKSkKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICB1c2luZyAoU1FMaXRlQ29tbWFuZCBjbWQgPSBjb25uZWN0aW9uLkNyZWF0ZUNvbW1hbmQoKSkKICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNtZC5Db21tYW5kVGV4dCA9ICJERUxFVEUgRlJPTSB0ZXN0X3RibCBXSEVSRSBpZD1AaWQiOwogICAgICAgICAgICAgICAgICAgICAgICBjbWQuUGFyYW1ldGVycy5BZGQoIkBpZCIsIERiVHlwZS5VSW50MzIpOwogICAgICAgICAgICAgICAgICAgICAgICBjbWQuUGFyYW1ldGVyc1swXS5WYWx1ZSA9IGlkOwogICAgICAgICAgICAgICAgICAgICAgICBjbWQuUHJlcGFyZSgpOwogICAgICAgICAgICAgICAgICAgICAgICBjbWQuRXhlY3V0ZU5vblF1ZXJ5KCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIHRyYW4uQ29tbWl0KCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0K