private void ExecuteButton_Click(object sender, EventArgs e)
        {
            IDbConnection conn = null;

            try
            {
                MainApplicationSettings.DBInfo dbInfo = (MainApplicationSettings.DBInfo)((ItemValue)DBConnectionComboBox.SelectedItem).key;

                _currentConnectionString = dbInfo.GetOracleConnectionString();

                this._provider = new DataProvider(_currentConnectionString, ProviderType.Oracle);

                conn = _provider.OpenConnection();

                string[] SQLStatements = _textArea.Text.Split(';');

                _provider.ExecuteNonQueryMultiple(SQLStatements);

                FillTableListComboBox(ref NewTableComboBox, true);

                NewTableComboBox.Enabled = true;
                NewTableLabel.Enabled    = true;
                MessageBox.Show("Execution completed succesfully", "Executed", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                CommonItem.ErrManger.ErrorManagement(ex, false, this);
            }
            finally
            {
                _provider.CloseConnection(conn);
            }
        }
        private DataTable GetTableData(string tableName)
        {
            IDbConnection conn    = null;
            IDbCommand    comm    = null;
            IDataAdapter  adapter = null;

            try
            {
                MainApplicationSettings.DBInfo dbInfo = (MainApplicationSettings.DBInfo)((ItemValue)DBConnectionComboBox.SelectedItem).key;

                _currentConnectionString = dbInfo.GetOracleConnectionString();

                this._provider = new DataProvider(_currentConnectionString, ProviderType.Oracle);


                conn = _provider.OpenConnection();


                string SQLStatement = null;
                SQLStatement = "select * from " + tableName;

                comm = new OracleCommand(SQLStatement, (OracleConnection)conn);

                adapter = new OracleDataAdapter();
                ((OracleDataAdapter)adapter).SelectCommand = (OracleCommand)comm;

                DataSet dataset = new DataSet();
                dataset.Locale = System.Globalization.CultureInfo.InvariantCulture;
                adapter.Fill(dataset);

                return(dataset.Tables[0]);
            }
            catch (Exception ex)
            {
                CommonItem.ErrManger.ErrorManagement(ex, false, this);
                return(null);
            }
            finally
            {
                _provider.CloseConnection(conn);
            }
        }
        private void FillTableListComboBox(ref ComboBox listToBeFilled, bool alreadyExisting)
        {
            IDbConnection conn = null;
            IDbCommand    comm = null;
            IDataReader   rdr  = null;

            try
            {
                List <string> actualList = new List <string>();

                MainApplicationSettings.DBInfo dbInfo = (MainApplicationSettings.DBInfo)((ItemValue)DBConnectionComboBox.SelectedItem).key;
                _currentConnectionString = dbInfo.GetOracleConnectionString();

                this._provider = new DataProvider(_currentConnectionString, ProviderType.Oracle);


                conn = _provider.OpenConnection();


                string SQLStatement = null;
                SQLStatement = "SELECT table_name FROM all_tables where owner =\'" + dbInfo.UserName.ToUpper() + "\' order by table_name";

                comm = new OracleCommand(SQLStatement, (OracleConnection)conn);
                rdr  = comm.ExecuteReader(System.Data.CommandBehavior.Default);
                if (rdr == null)
                {
                    return;
                }

                while (rdr.Read())
                {
                    string tmpString = rdr[0].ToString();
                    actualList.Add(tmpString);

                    if (!alreadyExisting)
                    {
                        listToBeFilled.Items.Add(tmpString);
                        _previousLoadedTable.Add(tmpString);
                    }
                    else
                    {
                        if (!_previousLoadedTable.Contains(tmpString))
                        {
                            listToBeFilled.Items.Add(tmpString);
                        }
                    }
                }

                _previousLoadedTable.Clear();
                _previousLoadedTable = actualList;
            }
            catch (Exception ex)
            {
                CommonItem.ErrManger.ErrorManagement(ex, false, this);
            }
            finally
            {
                if (rdr != null)
                {
                    rdr.Close();
                }
                _provider.CloseConnection(conn);
            }
        }