本文整理汇总了C#中SQLiteConnection.Commit方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteConnection.Commit方法的具体用法?C# SQLiteConnection.Commit怎么用?C# SQLiteConnection.Commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLiteConnection
的用法示例。
在下文中一共展示了SQLiteConnection.Commit方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ECOdatabase
public ECOdatabase ()
{
database = DependencyService.Get<ISqlite> ().GetConnection ();
// database.DeleteAll<CartItem> ();
//Create a CartItem table if there is no such table
if (database.TableMappings.All(t => t.MappedType.Name != typeof(CartItem).Name)) {
//Create cartitem table
database.CreateTable<CartItem> ();
database.Commit ();
}
if (database.TableMappings.All(t => t.MappedType.Name != typeof(BuyList).Name)) {
//Create cartitem table
database.CreateTable<BuyList> ();
database.Commit ();
}
if (database.TableMappings.All(t => t.MappedType.Name != typeof(WoolworthsItem).Name)) {
//Create cartitem table
database.CreateTable<WoolworthsItem> ();
database.Commit ();
}
// database.DeleteAll<BuyList>();
if (GetWoolWorthsItemAll ().Count == 0) {
WoolworthsItem item1 = new WoolworthsItem ("50375264", "Kleenex Tissues", 2.50);
InsertItemToWoolWorthsItem (item1);
}
}
示例2: Forum1DB
/// <summary>
/// Initializes a new instance of the <see cref="SuncorpNetwork.Data.PersonalDB"/> class.
/// </summary>
public Forum1DB()
{
database = DependencyService.Get<ISqlite> ().GetConnection ();
if(database.TableMappings.All(t => t.MappedType.Name != typeof(Forum1Post).Name)){
database.CreateTable<Forum1Post> ();
database.Commit ();
}
}
示例3: EventDatabase
public EventDatabase()
{
database = DependencyService.Get<ISqlite> ().GetConnection ();
if (database.TableMappings.All (t => t.MappedType.Name != typeof(Event).Name))
{
database.CreateTable<Event> ();
database.Commit ();
}
}
示例4: LoginTable
/// <summary>
/// Initializes a new instance of the <see cref="SuncorpNetwork.Data.ProjectDetialsDatabase"/> class.
/// </summary>
public LoginTable()
{
database = DependencyService.Get<ISqlite> ().GetConnection ();
if(database.TableMappings.All(t => t.MappedType.Name != typeof(LoginDetails).Name)){
database.CreateTable<LoginDetails> ();
database.Commit ();
}
}
示例5: NotificationsTable
public NotificationsTable()
{
database = DependencyService.Get<ISqlite> ().GetConnection ();
//database.DropTable<Notification> ();
if(database.TableMappings.All(t => t.MappedType.Name != typeof(Notification).Name)){
database.CreateTable<Notification> ();
database.Commit ();
}
}
示例6: NoteDatabase
public NoteDatabase()
{
database = DependencyService.Get<ISqlite> ().GetConnection ();
//TODO show IOC vs Dependency injection
// database = SimpleIoc.Default.GetInstance<ISqlite> ().GetConnection ();
if (database.TableMappings.All(t => t.MappedType.Name != typeof(Note).Name)) {
database.CreateTable<Note> ();
database.Commit ();
}
if (database.TableMappings.All(t => t.MappedType.Name != typeof(Person).Name)) {
database.CreateTable<Person> ();
database.Commit ();
}
if (database.TableMappings.All(t => t.MappedType.Name != typeof(Token).Name)) {
database.CreateTable<Token> ();
database.Commit ();
}
}
示例7: RemindersTable
public RemindersTable()
{
database = DependencyService.Get<ISqlite> ().GetConnection ();
//TODO show IOC vs Dependency injection
// database = SimpleIoc.Default.GetInstance<ISqlite> ().GetConnection ();
if (database.TableMappings.All(t => t.MappedType.Name != typeof(Reminder).Name)) {
database.CreateTable<Reminder> ();
database.Commit ();
}
}
示例8: ECOdatabase
public ECOdatabase ()
{
database = DependencyService.Get<ISqlite> ().GetConnection ();
// database.DeleteAll<CartItem> ();
//Create a CartItem table if there is no such table
if (database.TableMappings.All (t => t.MappedType.Name != typeof(CartItem).Name)) {
database.CreateTable<CartItem> ();
database.Commit ();
}
if (database.TableMappings.All (t => t.MappedType.Name != typeof(BuyList).Name)) {
//Create user table
database.CreateTable<BuyList> ();
database.Commit ();
}
if (database.TableMappings.All (t => t.MappedType.Name != typeof(WoolworthsItem).Name)) {
//Create cartitem table
database.CreateTable<WoolworthsItem> ();
database.Commit ();
}
}