private int FillLoadDataRow(SchemaMapping mapping) {
int rowsAddedToDataSet = 0;
DataReaderContainer dataReader = mapping.DataReader;
if (_hasFillErrorHandler) {
while (dataReader.Read()) { // read remaining rows of first and subsequent resultsets
try {
// only try-catch if a FillErrorEventHandler is registered so that
// in the default case we get the full callstack from users
mapping.LoadDataRowWithClear();
rowsAddedToDataSet++;
}
catch(Exception e) {
//
if (!ADP.IsCatchableExceptionType(e)) {
throw;
}
ADP.TraceExceptionForCapture(e);
OnFillErrorHandler(e, mapping.DataTable, mapping.DataValues);
}
}
}
else {
while (dataReader.Read()) { // read remaining rows of first and subsequent resultset
mapping.LoadDataRow();
rowsAddedToDataSet++;
}
}
return rowsAddedToDataSet;
}