Exemplo n.º 1
0
        public int Update(CommandType commandType, string
                          commandText, DataSet ds)
        {
            this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType);
            PrepareCommand(idbCommand, this.Connection, this.Transaction,
                           commandType,
                           commandText, this.Parameters);
            IDbDataAdapter dataAdapter = DBManagerFactory.GetDataAdapter
                                             (this.ProviderType);

            dataAdapter.UpdateCommand = idbCommand;
            int affectedRows = dataAdapter.Update(ds);

            idbCommand.Parameters.Clear();
            return(affectedRows);
        }
Exemplo n.º 2
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);
        }