System.Data.ProviderBase.SchemaMapping.LoadDataRowWithClear C# (CSharp) Method

LoadDataRowWithClear() private method

private LoadDataRowWithClear ( ) : void
return void
        internal void LoadDataRowWithClear()
        {
            // for FillErrorEvent to ensure no values leftover from previous row
            for (int i = 0; i < _readerDataValues.Length; ++i)
            {
                _readerDataValues[i] = null;
            }
            LoadDataRow();
        }

Usage Example

 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;
 }
All Usage Examples Of System.Data.ProviderBase.SchemaMapping::LoadDataRowWithClear