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


C# SQLiteConnection.DeleteAll方法代码示例

本文整理汇总了C#中SQLite.SQLiteConnection.DeleteAll方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteConnection.DeleteAll方法的具体用法?C# SQLiteConnection.DeleteAll怎么用?C# SQLiteConnection.DeleteAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SQLite.SQLiteConnection的用法示例。


在下文中一共展示了SQLiteConnection.DeleteAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: clearShapes

 public static void clearShapes()
 {
     completeLines.Clear();
     completeCircles.Clear();
     string dbPath = GetDBPath();
     SQLiteConnection db;
     db = new SQLiteConnection(dbPath);
     db.DeleteAll<Line>();
     db.DeleteAll<Circle>();
     db.Close();
     db = null;
 }
开发者ID:yingfangdu,项目名称:BNR,代码行数:12,代码来源:LineStore.cs

示例2: DontRememberMe

 public void DontRememberMe()
 {
     using (var dbConnection = new SQLiteConnection(_dbUnitAndroidPrinterAppCurrent))
     {
         dbConnection.DeleteAll<AccountDB>();
     }
 }
开发者ID:WakeDown,项目名称:UnitPrinter,代码行数:7,代码来源:UnitAPIShellAutorizator.cs

示例3: ClearData

 public void ClearData()
 {
   
         var dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "expenses.sqlite");
         using (var db = new SQLite.SQLiteConnection(dbPath))
         {
             db.DeleteAll<Data>();
         }
    
 }
开发者ID:mohamedemam0,项目名称:How-Much-App,代码行数:10,代码来源:MainPageViewModel.cs

示例4: DataManager

		public DataManager ()
		{

			string folder = Environment.GetFolderPath (Environment.SpecialFolder.Personal);

			sync = new SQLiteConnection (System.IO.Path.Combine (folder, "pengeplan.db"));

			sync.CreateTable<Transaction> ();
			sync.DeleteAll<Transaction> ();

		}
开发者ID:sadiq81,项目名称:Pengeplan_Xamarin,代码行数:11,代码来源:DataManager.cs

示例5: InitializeData

 public void InitializeData()
 {
     using (var db = new SQLite.SQLiteConnection(App.DBPath))
     {
         //Clear tables (for DEV purpoises only!)
         //TODO: later remove
         db.DeleteAll<User>();
         db.DeleteAll<Pet>();
         db.DeleteAll<PetStage>();
         db.DeleteAll<GameObject>();
         //User
         InserUser(db);
         //Pet
         InserPet(db);
         //Pet stages
         InsertPetStages(db);
         //Game objects
         InsertFood(db);
         InserActivities(db);
     }
 }
开发者ID:janisskuja,项目名称:metrotama,代码行数:21,代码来源:DatabaseInitRepository.cs

示例6: RememberMe

 public void RememberMe(AccountDB account)
 {
     using (var dbConnection = new SQLiteConnection(_dbUnitAndroidPrinterAppCurrent))
     {
         dbConnection.DeleteAll<AccountDB>();
         dbConnection.Insert(new AccountDB()
         {
             Sid = account.Sid,
             CurUserAdSid = account.CurUserAdSid,
             Login = account.Login,
             Password = account.Password
         });
     }
 }
开发者ID:WakeDown,项目名称:UnitPrinter,代码行数:14,代码来源:UnitAPIShellAutorizator.cs

示例7: createSystemUser

        //-----------sets an fake user for recognizing if welcome screen should be ignored or not---------//
        protected void createSystemUser()
        {
            var db = new SQLiteConnection (dbPath);

            var rowCount = db.Table<User> ().Count ();

            if (rowCount > 2) {
                db.DeleteAll<User> ();
            }

            if (!hasInserted) {
                Log.Info (Tag, "libber");
                var result = insertUpdateData(new User{ ID = 2, FirstName = string.Format("SystemUser", System.DateTime.Now.Ticks),
                    LastName = "Mr.Anderson",
                }, db);
                hasInserted = true;
            } else {
                var rowcount = db.Delete(new User(){ID=2});
            }
        }
开发者ID:rhialy,项目名称:IMD3Amsterdam,代码行数:21,代码来源:WelcomeScreen.cs

示例8: Main

		public static void Main (string[] args)
		{
			Console.WriteLine ("Hello SQLite-net Data!");

			// We're using a file in Assets instead of the one defined above
			//string dbPath = Directory.GetCurrentDirectory ();
			string dbPath = @"../../../DataAccess-Android/Assets/stocks.db3";
			var db = new SQLiteConnection (dbPath);

			// Create a Stocks table
			if (db.CreateTable<Stock>() == 0)
			{
				// A table already exixts, delete any data it contains
				db.DeleteAll<Stock> ();
			}

			AddStocksToDb (db, "GOOG", "Google", "GoogleStocks.csv");
			AddStocksToDb (db, "EA", "Electronic Arts", "EAStocks.csv");
			AddStocksToDb (db, "SNE", "Sony", "SonyStocks.csv");

		}
开发者ID:tvangeest,项目名称:CS235AM-Demos,代码行数:21,代码来源:Program.cs

示例9: DropTableStatut

        //DROP ALL TABLE
        public string DropTableStatut()
        {
            try
            {
                string dbPath = System.IO.Path.Combine(Environment.GetFolderPath
                    (Environment.SpecialFolder.Personal),"ormDMS.db3");
                var db = new SQLiteConnection(dbPath);
                db.DeleteAll<TablePosition>();
                db.DeleteAll<TableVoyage>();
                db.DeleteAll<TableUser>();
                db.DeleteAll<TableEvenement>();
                string result = "Table vidée";
                return result;
            }
            catch (Exception ex)
            {
                return "Erreur : " + ex.Message;

            }
        }
开发者ID:Dealtis,项目名称:DCS,代码行数:21,代码来源:DBRepository.cs

示例10: CreateDB

 public void CreateDB()
 {
   
     string dbPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "carrito.db3");
     var db = new SQLiteConnection(dbPath);
     db.CreateTable<SQProduct>();
     db.DeleteAll<SQProduct>();
     
     
 }
开发者ID:javiergandres,项目名称:PracticasNET,代码行数:10,代码来源:MainActivity.cs

示例11: ClearPostedInv

        void ClearPostedInv()
        {
            CompanyInfo para = DataHelper.GetCompany (pathToDatabase);
            if (!para.AllowClrTrxHis) {
                Toast.MakeText (this, "Access denied...", ToastLength.Long).Show ();
                return;
            }
            using (var db = new SQLite.SQLiteConnection(pathToDatabase))
            {
                db.DeleteAll<InvoiceDtls> ();
                db.DeleteAll<Invoice> ();
                db.DeleteAll<CNNoteDtls> ();
                db.DeleteAll<CNNote> ();
            //				var list2 = db.Table<Invoice> ().Where (x => x.isUploaded == true).ToList<Invoice> ();
            //				db.RunInTransaction (() => {
            //					foreach (var item in list2) {
            //						var listitm = db.Table<InvoiceDtls> ().Where (x => x.invno == item.invno).ToList<InvoiceDtls> ();
            //						foreach(var iitem in listitm){
            //							db.Delete(iitem);
            //						}
            //						db.Delete(item);
            //					}
            //				});
            //
            //				var list3 = db.Table<CNNote> ().Where (x => x.isUploaded == true).ToList<CNNote> ();
            //				db.RunInTransaction (() => {
            //					foreach (var item in list3) {
            //						var listitm = db.Table<CNNoteDtls> ().Where (x => x.cnno == item.cnno).ToList<CNNoteDtls> ();
            //						foreach(var iitem in listitm){
            //							db.Delete(iitem);
            //						}
            //						db.Delete(item);
            //					}
            //				});

                Toast.MakeText (this, "Transaction clear...", ToastLength.Long).Show ();
            }
        }
开发者ID:mokth,项目名称:merpV2Production,代码行数:38,代码来源:MainActivity.cs

示例12: settingTags

        //-----------sets the tag in the user.cs for further utilization in the application---------//
        protected void settingTags()
        {
            var db = new SQLiteConnection (dbPath);
            var rowCount = db.Table<User> ().Count ();

            if (rowCount > 2) {
                db.DeleteAll<User> ();
            }

            if (!hasInserted) {
                Log.Info (Tag, "libber");
                var result = insertUpdateData(new User{ ID = 1, FirstName = string.Format("xxxxx", System.DateTime.Now.Ticks),
                    LastName = "Smith",
                    Standards = hasStandards,
                }, db);
                hasInserted = true;
            } else {
                var rowcount = db.Delete(new User(){ID=1});
                settingTags ();
            }
        }
开发者ID:rhialy,项目名称:IMD3Amsterdam,代码行数:22,代码来源:MainPreferencesPhaseOne.cs

示例13: Trunk

        public static void Trunk()
        {
            string dbPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "cust.db");

            var db = new SQLiteConnection (dbPath);
            db.DeleteAll<schede> ();
        }
开发者ID:frungillo,项目名称:vegetha,代码行数:7,代码来源:scheda.cs

示例14: ClearPostedInv

 void ClearPostedInv()
 {
     CompanyInfo para = DataHelper.GetCompany (pathToDatabase);
     if (!para.AllowClrTrxHis) {
         Toast.MakeText (this, Resources.GetString(Resource.String.msg_accessdenied), ToastLength.Long).Show ();
         return;
     }
     using (var db = new SQLite.SQLiteConnection(pathToDatabase))
     {
         db.DeleteAll<InvoiceDtls> ();
         db.DeleteAll<Invoice> ();
         db.DeleteAll<CNNoteDtls> ();
         db.DeleteAll<CNNote> ();
         Toast.MakeText (this,Resources.GetString(Resource.String.msg_trxclear), ToastLength.Long).Show ();
     }
 }
开发者ID:mokth,项目名称:merpV3,代码行数:16,代码来源:MainActivity.cs

示例15: InsertCustomerIntoDb

        private void InsertCustomerIntoDb(List<Customer> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;
            using (var db = new SQLite.SQLiteConnection(pathToDatabase))
            {
                //var list2 = db.Table<Trader>().ToList<Trader>();
                db.DeleteAll<Trader> ();// (list2);
                foreach (Customer item in list) {
                    Trader itm = new Trader ();
                    itm.CustCode = item.CustomerCode;
                    itm.CustName = item.CustomerName;
                    itm.Addr1 = item.Addr1;
                    itm.Addr2 = item.Addr2;
                    itm.Addr3 = item.Addr3;
                    itm.Addr4 = item.Addr4;
                    itm.Tel = item.Tel;
                    itm.Fax = item.Fax;
                    itm.gst = item.Gst;
                    itm.PayCode = item.PayCode;

                    db.Insert (itm);
            //					if (list2.Where (x => x.CustCode == itm.CustCode).ToList ().Count () == 0) {
            //						db.Insert (itm);
            //					} else {
            //						db.Update (itm);
            //					}
                }
            }

            if (_downloadAll) {
                FireEvent (EventID.LOGIN_DOWNCOMPLETE);
                DownloadAllhandle.Invoke(CallingActivity,list.Count,"Successfully downloaded "+list.Count.ToString()+" customer(s).");
            }else Downloadhandle.Invoke(CallingActivity,list.Count,"Successfully downloaded "+list.Count.ToString()+" customer(s).");
        }
开发者ID:mokth,项目名称:merpV2Production,代码行数:34,代码来源:DownloadHelper.cs


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