Exemple #1
0
        private bool FillNextResult(DataReaderContainer dataReader)
        {
            bool result = true;

            if (_hasFillErrorHandler)
            {
                try {
                    // only try-catch if a FillErrorEventHandler is registered so that
                    // in the default case we get the full callstack from users
                    result = dataReader.NextResult();
                }
                catch (Exception e) {
                    //
                    if (!ADP.IsCatchableExceptionType(e))
                    {
                        throw;
                    }
                    ADP.TraceExceptionForCapture(e);
                    OnFillErrorHandler(e, null, null);
                }
            }
            else
            {
                result = dataReader.NextResult();
            }
            return(result);
        }
Exemple #2
0
        private bool FillNextResult(DataReaderContainer dataReader)
        {
            bool flag = true;

            if (this._hasFillErrorHandler)
            {
                try
                {
                    flag = dataReader.NextResult();
                }
                catch (Exception exception)
                {
                    if (!ADP.IsCatchableExceptionType(exception))
                    {
                        throw;
                    }
                    ADP.TraceExceptionForCapture(exception);
                    this.OnFillErrorHandler(exception, null, null);
                }
                return(flag);
            }
            return(dataReader.NextResult());
        }
Exemple #3
0
 internal int FillFromReader(DataSet dataset, DataTable datatable, string srcTable, DataReaderContainer dataReader, int startRecord, int maxRecords, DataColumn parentChapterColumn, object parentChapterValue)
 {
     int result = 0;
     int num = 0;
     do
     {
         if (0 < dataReader.FieldCount)
         {
             SchemeMap schemaMapping = this.FillMapping(dataset, datatable, srcTable, dataReader, num, parentChapterColumn, parentChapterValue);
             num++;
             if (schemaMapping != null && schemaMapping.DataValues != null && schemaMapping.DataTable != null)
             {
                 schemaMapping.DataTable.BeginLoadData();
                 try
                 {
                     if (1 == num && (0 < startRecord || 0 < maxRecords))
                     {
                         result = this.FillLoadDataRowChunk(schemaMapping, startRecord, maxRecords);
                     }
                     else
                     {
                         int num2 = this.FillLoadDataRow(schemaMapping);
                         if (1 == num)
                         {
                             result = num2;
                         }
                     }
                 }
                 finally
                 {
                     schemaMapping.DataTable.EndLoadData();
                 }
                 if (datatable != null)
                 {
                     break;
                 }
             }
         }
     }
     while (dataReader.NextResult());
     return result;
 }