Пример #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);
        }
Пример #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);
 }
Пример #3
0
 public void BeginTransaction()
 {
     if (this.idbTransaction == null)
     {
         if (idbConnection != null)
         {
             idbTransaction = idbConnection.BeginTransaction();
         }
         else
         {
             idbTransaction =
                 DBManagerFactory.GetTransaction(this.ProviderType);
         }
     }
     this.idbCommand.Transaction = idbTransaction;
 }
Пример #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);
        }
Пример #5
0
 public void CreateParameters(int paramsCount)
 {
     idbParameters = new IDbDataParameter[paramsCount];
     idbParameters = DBManagerFactory.GetParameters(this.ProviderType, paramsCount);
 }