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


C# SQLiteConnection.Dispose方法代码示例

本文整理汇总了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);
 }
开发者ID:marceloodir,项目名称:LojaPhoneRestSQLite,代码行数:11,代码来源:DataBaseHelperAccess.cs

示例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);
     }
 }
开发者ID:prabaprakash,项目名称:Visual-Studio-2013,代码行数:25,代码来源:Login.xaml.cs

示例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();
        }
开发者ID:KirillChernoff,项目名称:Studio,代码行数:14,代码来源:TagDictionary.xaml.cs

示例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();
         //}); 
     }
 }
开发者ID:ThanhBui92,项目名称:T.note,代码行数:14,代码来源:DatabaseHelper.cs

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

示例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);
            }
        }
开发者ID:FrederickEskens,项目名称:Totem,代码行数:32,代码来源:Database.cs

示例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();
         //}); 
     }
 } 
开发者ID:kreyosopensource,项目名称:KreyosWP,代码行数:14,代码来源:DatabaseManager.cs


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