private void btnGenerateDestination_Click(object sender, EventArgs e)
        {
            frmConnectionManager manager = new frmConnectionManager(this, ref db_destination);

            if (manager.ShowDialog() == DialogResult.OK)
            {
                tbConnectionDestination.Text = db_destination.GetConnectionString();
            }
        }
        private void btnGenerateSource_Click(object sender, EventArgs e)
        {
            frmConnectionManager manager = new frmConnectionManager(this, ref db_source);

            if (manager.ShowDialog() == DialogResult.OK)
            {
                tbConnectionSource.Text = db_source.GetConnectionString();

                loadDatabases(db_source, cbDatabaseSource);
            }
        }
        private void loadDatabases(proGEDIA.Utilities.Database db, ComboBox cb)
        {
            cb.Items.Clear();
            switch (db.serverType.ToLower())
            {
            case "mssql":
                if (db_source.mssqlCon != null && db_source.mssqlCon.State == ConnectionState.Open)
                {
                    db_source.mssqlCon.Close();
                }

                if (db_source.mssqlCon == null)
                {
                    db_source.mssqlCon = new SqlConnection();
                }

                db_source.mssqlCon.ConnectionString = db.GetConnectionString();
                try {
                    db_source.mssqlCon.Open();
                } catch (Exception ex) {
                    MessageBox.Show("Could not connect to database.\r\n" + ex.Message);

                    return;
                }

                SqlCommand mssqlCom = db_source.mssqlCon.CreateCommand();
                mssqlCom.CommandText = "SELECT name FROM sys.databases WHERE name NOT IN('master', 'tempdb', 'model', 'msdb') ORDER BY name";
                try {
                    SqlDataReader mssqlReader = mssqlCom.ExecuteReader();
                    while (mssqlReader.Read())
                    {
                        cb.Items.Add(mssqlReader[0].ToString());
                    }
                    mssqlReader.Close();
                } catch (Exception ex) {
                    MessageBox.Show("Could not get database list.\r\n" + ex.Message);
                }
                break;

            case "mysql":
                if (db_source.mysqlCon != null && db_source.mysqlCon.State == ConnectionState.Open)
                {
                    db_source.mysqlCon.Close();
                }

                if (db_source.mysqlCon == null)
                {
                    db_source.mysqlCon = new MySqlConnection();
                }

                db_source.mysqlCon.ConnectionString = db.GetConnectionString();
                try {
                    db_source.mysqlCon.Open();
                } catch (Exception ex) {
                    MessageBox.Show("Could not connect to database.\r\n" + ex.Message);

                    return;
                }

                MySqlCommand mysqlCom = db_source.mysqlCon.CreateCommand();
                mysqlCom.CommandText = "SELECT schema_name FROM information_schema.schemata WHERE schema_name NOT LIKE '%schema' ORDER BY schema_name";
                try {
                    MySqlDataReader mysqlReader = mysqlCom.ExecuteReader();
                    while (mysqlReader.Read())
                    {
                        cb.Items.Add(mysqlReader[0].ToString());
                    }
                    mysqlReader.Close();
                } catch (Exception ex) {
                    MessageBox.Show("Could not get database list.\r\n" + ex.Message);
                }
                break;

            case "sqlite":
                if (db_source.sqliteCon != null && db_source.sqliteCon.State == ConnectionState.Open)
                {
                    db_source.sqliteCon.Close();
                }

                if (db_source.sqliteCon == null)
                {
                    db_source.sqliteCon = new SQLiteConnection();
                }

                db_source.sqliteCon.ConnectionString = db.GetConnectionString();
                try {
                    db_source.sqliteCon.Open();
                } catch (Exception ex) {
                    MessageBox.Show("Could not connect to database.\r\n" + ex.Message);

                    return;
                }

                cb.Items.Add(db_source.serverName);
                cb.SelectedIndex = 0;
                break;
            }
        }