Exemplo n.º 1
0
        public int UpdateDataset(SqlStatement selectSql, DataSet ds, int updateBatchSize, UpdateRowSource updateRowSource)
        {
            int ret = 0;

            DbEntry.UsingConnection(
                () => {
                var c = GetDbCommand(selectSql);
                c.UpdatedRowSource = updateRowSource;
                var d             = (DbDataAdapter)InnerDriver.GetDbAdapter(c);
                var cb            = InnerDriver.GetCommandBuilder();
                cb.QuotePrefix    = Dialect.OpenQuote.ToString();
                cb.QuoteSuffix    = Dialect.CloseQuote.ToString();
                cb.DataAdapter    = d;
                d.UpdateBatchSize = updateBatchSize;
                ret = d.Update(ds);
                ds.AcceptChanges();
            });
            return(ret);
        }