当前位置: 首页>>代码示例>>C#>>正文


C# SQLiteConnection.Commit方法代码示例

本文整理汇总了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);
			}

		}
开发者ID:joagwa,项目名称:EasyTechy,代码行数:31,代码来源:ECOdatabase.cs

示例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 ();
            }
        }
开发者ID:jarade,项目名称:IAB330Project,代码行数:12,代码来源:Forum1DB.cs

示例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 ();
			}
		}
开发者ID:Jared1204,项目名称:ConnectRepo,代码行数:9,代码来源:EventDatabase.cs

示例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 ();
            }
        }
开发者ID:jarade,项目名称:IAB330Project,代码行数:12,代码来源:LoginTable.cs

示例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 ();
     }
 }
开发者ID:jarade,项目名称:IAB330Project,代码行数:9,代码来源:NotificationsTable.cs

示例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 ();
     }
 }
开发者ID:dittopower,项目名称:330-App---Tconnect,代码行数:18,代码来源:NoteDatabase.cs

示例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 ();
     }
 }
开发者ID:jonathancromie,项目名称:CaAPa,代码行数:10,代码来源:RemindersTable.cs

示例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 ();
			}
				
		}
开发者ID:joagwa,项目名称:EasyTechy,代码行数:24,代码来源:ECOdatabase.cs


注:本文中的SQLiteConnection.Commit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。