Пример #1
0
 public IDataReader ExecuteReader(CommandType commandType, string commandText)
 {
     this.idbCommand       = DBManagerFactory.GetCommand(this.ProviderType);
     idbCommand.Connection = this.Connection;
     PrepareCommand(idbCommand, this.Connection, this.Transaction, commandType, commandText, this.Parameters);
     this.DataReader = idbCommand.ExecuteReader();
     idbCommand.Parameters.Clear();
     return(this.DataReader);
 }
Пример #2
0
        public object ExecuteScalar(CommandType commandType, string commandText)
        {
            this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType);
            PrepareCommand(idbCommand, this.Connection, this.Transaction, commandType, commandText, this.Parameters);
            object returnValue = idbCommand.ExecuteScalar();

            idbCommand.Parameters.Clear();
            return(returnValue);
        }
Пример #3
0
        //public OracleParameter[] RefParameters
        //{
        //    get
        //    {
        //        return refcurParameters;
        //    }
        //}



        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);
        }
Пример #4
0
        public DataTable ExecuteProcedure(CommandType commandType, string commandText)
        {
            this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType);
            PrepareCommand(idbCommand, this.Connection, this.Transaction, commandType, commandText, this.Parameters);
            IDataReader reader = idbCommand.ExecuteReader();
            DataTable   dt     = new DataTable();

            dt.Load(reader);
            reader.Dispose();
            idbCommand.Parameters.Clear();
            return(dt);
        }
Пример #5
0
        public DataSet ExecuteDataSet(CommandType commandType, string commandText)
        {
            this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType);
            //PrepareCommand(idbCommand,this.Connection, this.Transaction,commandType,commandText);
            this.Command.CommandText = commandText;
            this.Command.CommandType = commandType;
            this.Command.Connection  = this.Connection;
            if (this.Parameters != null)
            {
                AttachParameters(this.Command, this.Parameters);
            }
            IDbDataAdapter dataAdapter = DBManagerFactory.GetDataAdapter(this.ProviderType);

            dataAdapter.SelectCommand = this.Command;
            DataSet dataSet = new DataSet();

            dataAdapter.Fill(dataSet);
            idbCommand.Parameters.Clear();
            return(dataSet);
        }
Пример #6
0
 public void CreateParameters(int paramsCount)
 {
     idbParameters = new IDbDataParameter[paramsCount];
     idbParameters = DBManagerFactory.GetParameters(this.ProviderType, paramsCount);
 }