Exemple #1
0
        public IDataReader ExecuteReader(CommandType commandType, string commandText)
        {
            dbEntity.Command            = DBManagerFactory.GetCommand(dbEntity.ProviderType);
            dbEntity.Command.Connection = dbEntity.Connection;
            PrepareCommand(dbEntity.Command, dbEntity.Connection, dbEntity.Transaction, commandType, commandText, dbEntity.Parameters);
            dbEntity.DataReader = dbEntity.Command.ExecuteReader();
            dbEntity.Command.Parameters.Clear();

            return(dbEntity.DataReader);
        }
Exemple #2
0
        public int ExecuteNonQuery(CommandType commandType, string commandText)
        {
            dbEntity.Command = DBManagerFactory.GetCommand(dbEntity.ProviderType);
            this.PrepareCommand(dbEntity.Command, dbEntity.Connection, dbEntity.Transaction, commandType, commandText, dbEntity.Parameters);
            int returnValue = dbEntity.Command.ExecuteNonQuery();

            dbEntity.Command.Parameters.Clear();

            return(returnValue);
        }
Exemple #3
0
        public DataSet ExecuteDataSet(CommandType commandType, string commandText)
        {
            dbEntity.Command = DBManagerFactory.GetCommand(dbEntity.ProviderType);
            this.PrepareCommand(dbEntity.Command, dbEntity.Connection, dbEntity.Transaction, commandType, commandText, dbEntity.Parameters);
            IDbDataAdapter dataAdapter = DBManagerFactory.GetDataAdapter(dbEntity.ProviderType);

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

            dataAdapter.Fill(dataSet);
            dbEntity.Command.Parameters.Clear();

            return(dataSet);
        }