Exemplo n.º 1
0
        //Export All tables to database
        private void buttonExportAll_Click(object sender, EventArgs e)
        {
            if (!(global.connectDb))
            {
                addStatus("Please set destination database and click Export again");
            }
            else
            {
                foreach (ComboboxItem lbi in listBoxTables.Items)
                {

                    string tableName = lbi.ToString();
                    string query = lbi.Value.ToString();
                    currentDt = SqlLiteDbUtil.getTableData(global.sqlLiteDbFilePath, tableName);
                    exportTable(tableName, query, currentDt);

                }
            }
        }
Exemplo n.º 2
0
        //Upon clicking on the table name from the list box (on the left side)
        //it load data for that table and display it on the data grid view
        private void listBoxTables_SelectedIndexChanged(object sender, EventArgs e)
        {
            string tableName = listBoxTables.SelectedItem.ToString();
            currentDt = SqlLiteDbUtil.getTableData(global.sqlLiteDbFilePath, tableName);
            if (null != currentDt)
            {
                
                dataGridView1.DataSource = currentDt;
                
                addStatus("Table read successfull. History is ready to export.");

                 
                if (global.connectDb)
                {
                    buttonExportSel.Enabled = true;
                }

            }
            else
            {
                addStatus("Falied to read the table.");
            }
        }