本文整理汇总了C#中SQLite.SQLiteConnection.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteConnection.Dispose方法的具体用法?C# SQLiteConnection.Dispose怎么用?C# SQLiteConnection.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLite.SQLiteConnection
的用法示例。
在下文中一共展示了SQLiteConnection.Dispose方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InserindoListaFabricantes
public void InserindoListaFabricantes(List<Fabricante> fabricantes)
{
using (var dbConn = new SQLiteConnection(DB_path))
{
dbConn.DropTable<Fabricante>();
dbConn.Dispose();
dbConn.Close();
}
foreach (Fabricante f in fabricantes)
this.Inserindo(f);
}
示例2: Login_Loaded
async void Login_Loaded()
{
try
{
await ApplicationData.Current.LocalFolder.CreateFileAsync("Shopping.db3");
var path = Path.Combine(ApplicationData.Current.LocalFolder.Path, "Shopping.db3");
using (var db = new SQLite.SQLiteConnection(path))
{
// Create the tables if they don't exist
db.CreateTable<ShopLists>();
db.CreateTable<ShopAdmins>();
db.Commit();
db.Dispose();
db.Close();
}
ServiceReference1.SoapServiceSoapClient sc=new SoapServiceSoapClient();
sc.AllCouponsCompleted += (a, b) => MessageBox.Show(b.Result);
sc.AllCouponsAsync("hacking");
}
catch (Exception ex)
{
FaultHandling(ex.StackTrace);
}
}
示例3: getFromDB
private void getFromDB(out Dictionary<string, string> dict, string Parent)
{
string dbPath = "test.sqlite";
var db = new SQLiteConnection(dbPath, true);
var temp = db.Query<Tag>("SELECT * FROM Tag WHERE Parent='" + Parent + "'");
dict = new Dictionary<string, string>();
foreach (Tag el in temp)
{
dict.Add(el.Path, el.Name);
}
db.Dispose();
}
示例4: DeleteAllContact
//Delete all contactlist or delete Contacts table
public void DeleteAllContact()
{
using (var dbConn = new SQLiteConnection(App.DB_PATH))
{
//dbConn.RunInTransaction(() =>
// {
dbConn.DropTable<GhiChu>();
dbConn.CreateTable<GhiChu>();
dbConn.Dispose();
dbConn.Close();
//});
}
}
示例5: DeleteAllContact
}//DELETE CONTACT THAT I CHOSE
//DELETE ALL
public void DeleteAllContact()
{
using (var dbConn = new SQLiteConnection(App.DB_PATH))
{
dbConn.DropTable<Contactos>();
dbConn.CreateTable<Contactos>();
dbConn.Dispose();
dbConn.Close();
}
}
示例6: CreateDatabase
void CreateDatabase(string dbPath)
{
#if __ANDROID__
var s = Application.Context.Assets.Open(originalDBLocation);
var writeStream = new FileStream(dbPath, FileMode.OpenOrCreate, FileAccess.Write);
ReadWriteStream(s, writeStream);
writeStream.Close();
#elif __IOS__
var appDir = NSBundle.MainBundle.ResourcePath;
var originalLocation = Path.Combine (appDir, originalDBLocation);
File.Copy (originalLocation, dbPath);
#endif
//copies profiles and selected eigenschappen from the old database to the new one
if (File.Exists(OldDatabasePath)) {
SQLiteConnection oldDb = new SQLiteConnection(OldDatabasePath);
SQLiteConnection newDB = new SQLiteConnection(dbPath);
var oldProfielen = oldDb.Query<Profiel>("SELECT * FROM profiel");
var oldEigenschappenSer = oldDb.Query<Profiel_eigenschappen>("SELECT * FROM profiel_eigenschappen");
foreach(Profiel p in oldProfielen)
newDB.Execute("INSERT INTO profiel (name, nid) values (?, ?)", p.name, p.nid);
foreach (Profiel_eigenschappen pe in oldEigenschappenSer)
newDB.Execute("INSERT INTO profiel_eigenschappen (name, eigenschappen_ser) values (?, ?)", pe.name, pe.eigenschappen_ser);
oldDb.Dispose();
newDB.Dispose();
File.Delete(OldDatabasePath);
}
}
示例7: DeleteActivities
//~~~delete all activities
public void DeleteActivities ()
{
using (var dbConn = new SQLiteConnection(this.KreyosDBPath))
{
//dbConn.RunInTransaction(() =>
// {
dbConn.DropTable<Kreyos_User_Activities>();
dbConn.CreateTable<Kreyos_User_Activities>();
dbConn.Dispose();
dbConn.Close();
//});
}
}