Ejemplo n.º 1
0
        private void copyTmpToMahasiswa()
        {
            cKoneksi koneksi = new cKoneksi();

            using (var conn = new SQLiteConnection(koneksi.LokasiSqlite()))//koneksi ke sqlite
            {
                try
                {
                    conn.Open();//buka koneksi
                    using (var cmd = new SQLiteCommand(conn))
                    {
                        using (var transaction = conn.BeginTransaction())
                        {
                            cQuery qr = new cQuery();
                            cmd.CommandText = qr.qCopyTmpToMhs();
                            cmd.ExecuteNonQuery();

                            transaction.Commit();
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    conn.Close(); //tutup koneksi
                    conn.Dispose();
                }
            }
        }