Example #1
0
        public int ExecuteNonQuery(CommandType commandType, string commandText)
        {
            this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType);
            PrepareCommand(idbCommand, this.Connection, this.Transaction,
                           commandType, commandText, this.Parameters);
            int returnValue = idbCommand.ExecuteNonQuery();

            idbCommand.Parameters.Clear();
            return(returnValue);
        }
Example #2
0
 public void Open()
 {
     idbConnection =
         DBManagerFactory.GetConnection(this.providerType);
     idbConnection.ConnectionString = this.ConnectionString;
     if (idbConnection.State != ConnectionState.Open)
     {
         idbConnection.Open();
     }
     this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType);
 }
Example #3
0
 public IDataReader ExecuteReader(CommandType commandType, string commandText)
 {
     this.idbCommand           = DBManagerFactory.GetCommand(this.ProviderType);
     idbCommand.Connection     = this.Connection;
     idbCommand.CommandTimeout = 900;
     PrepareCommand(idbCommand, this.Connection, this.Transaction,
                    commandType,
                    commandText, this.Parameters);
     this.DataReader = idbCommand.ExecuteReader();
     idbCommand.Parameters.Clear();
     return(this.DataReader);
 }
Example #4
0
        public DataSet ExecuteDataSet(CommandType commandType, string commandText)
        {
            this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType);
            PrepareCommand(idbCommand, this.Connection, this.Transaction, commandType, commandText, this.Parameters);
            IDbDataAdapter dataAdapter = DBManagerFactory.GetDataAdapter
                                             (this.ProviderType);

            dataAdapter.SelectCommand = idbCommand;
            DataSet dataSet = new DataSet();

            dataAdapter.Fill(dataSet);
            idbCommand.Parameters.Clear();
            return(dataSet);
        }
Example #5
0
        public DataSet ExecuteDataSet(CommandType commandType, string commandText, int startRecord, int maxRecords, string srcTable)
        {
            this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType);
            PrepareCommand(idbCommand, this.Connection, this.Transaction, commandType, commandText, this.Parameters);
            IDbDataAdapter dataAdapter = DBManagerFactory.GetDataAdapter
                                             (this.ProviderType);

            dataAdapter.SelectCommand = idbCommand;
            DataSet dataSet = new DataSet();

            ((SqlDataAdapter)dataAdapter).Fill(dataSet, startRecord, maxRecords, srcTable);
#if MySql
            ((MySqlDataAdapter)dataAdapter).Fill(dataSet, startRecord, maxRecords, srcTable);
#endif
            idbCommand.Parameters.Clear();
            return(dataSet);
        }