本文整理汇总了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;
}
示例2: DontRememberMe
public void DontRememberMe()
{
using (var dbConnection = new SQLiteConnection(_dbUnitAndroidPrinterAppCurrent))
{
dbConnection.DeleteAll<AccountDB>();
}
}
示例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>();
}
}
示例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> ();
}
示例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);
}
}
示例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
});
}
}
示例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});
}
}
示例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");
}
示例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;
}
}
示例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>();
}
示例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 ();
}
}
示例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 ();
}
}
示例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> ();
}
示例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 ();
}
}
示例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).");
}