88 [RequiresUnreferencedCode(
"Using LoadOption may cause members from types used in the expression column to be trimmed if not referenced directly.")]
91 if ((uint)
value <= 3u)
109 if ((uint)(
value - 1) <= 2u)
127 if ((uint)(
value - 1) <= 3u)
138 [DefaultValue(
false)]
157 if (dataTableMappingCollection ==
null)
160 if (dataTableMappingCollection ==
null)
166 return dataTableMappingCollection;
227 [Obsolete(
"CloneInternals() has been deprecated. Use the DataAdapter(DataAdapter from) constructor instead.")]
250 foreach (
object tableMapping
in from.TableMappings)
262 protected override void Dispose(
bool disposing)
268 base.Dispose(disposing);
271 [RequiresUnreferencedCode(
"IDataReader's (built from adapter commands) schema table types cannot be statically analyzed.")]
277 [RequiresUnreferencedCode(
"dataReader's schema table types cannot be statically analyzed.")]
280 long scopeId =
DataCommonEventSource.
Log.EnterScope(
"<comm.DataAdapter.FillSchema|API> {0}, dataSet, schemaType={1}, srcTable, dataReader",
ObjectID, schemaType);
291 if (
string.IsNullOrEmpty(srcTable))
295 if (dataReader ==
null || dataReader.
IsClosed)
308 [RequiresUnreferencedCode(
"dataReader's schema table types cannot be statically analyzed.")]
314 if (dataTable ==
null)
322 if (dataReader ==
null || dataReader.
IsClosed)
335 [RequiresUnreferencedCode(
"dataReader's schema table types cannot be statically analyzed.")]
345 string sourceTableName =
null;
351 SchemaMapping schemaMapping =
new SchemaMapping(
this, dataset, datatable, dataReaderContainer, keyInfo:
true, schemaType, sourceTableName, gettingData:
false,
null,
null);
352 if (datatable !=
null)
364 if (
obj ==
null && datatable ==
null)
385 if (
string.IsNullOrEmpty(srcTable))
389 if (dataReader ==
null)
406 return FillFromReader(dataSet,
null, srcTable, dataReader2, startRecord, maxRecords);
417 return Fill(dataTables, dataReader, 0, 0);
426 if (dataTables ==
null || dataTables.Length == 0 || dataTables[0] ==
null)
430 if (dataReader ==
null)
434 if (1 < dataTables.Length && (startRecord != 0 || maxRecords != 0))
446 dataSet.EnforceConstraints =
false;
448 for (
int i = 0; i < dataTables.Length && !dataReader.
IsClosed; i++)
462 while (flag2 && dataReaderContainer.
FieldCount <= 0);
470 int num =
FillFromReader(
null, dataTables[i],
null, dataReaderContainer, startRecord, maxRecords);
489 dataSet.EnforceConstraints =
true;
500 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"parentChapterValue is not used here")]
503 return FillFromReader(dataset, datatable, srcTable, dataReader, startRecord, maxRecords,
null,
null);
506 [RequiresUnreferencedCode(
"parentChapterValue's type cannot be statically analyzed")]
517 SchemaMapping schemaMapping =
FillMapping(dataset, datatable, srcTable, dataReader, num, parentChapterColumn, parentChapterValue);
519 if (schemaMapping ==
null || schemaMapping.
DataValues ==
null || schemaMapping.
DataTable ==
null)
526 if (1 == num && (0 < startRecord || 0 < maxRecords))
543 if (datatable !=
null)
552 [RequiresUnreferencedCode(
"Row chapter column types cannot be statically analyzed")]
556 while (0 < startRecord)
558 if (!dataReader.
Read())
567 while (num < maxRecords && dataReader.
Read())
596 [RequiresUnreferencedCode(
"Row chapter column types cannot be statically analyzed")]
603 while (dataReader.
Read())
619 while (dataReader.
Read())
628 [RequiresUnreferencedCode(
"parentChapterValue's type cannot be statically analyzed")]
632 string sourceTableName =
null;
637 return new SchemaMapping(
this, dataset, datatable, dataReader, keyInfo,
SchemaType.Mapped, sourceTableName, gettingData:
true, parentChapterColumn, parentChapterValue);
640 [RequiresUnreferencedCode(
"parentChapterValue's type cannot be statically analyzed")]
648 result =
FillMappingInternal(dataset, datatable, srcTable, dataReader, schemaCount, parentChapterColumn, parentChapterValue);
658 result =
FillMappingInternal(dataset, datatable, srcTable, dataReader, schemaCount, parentChapterColumn, parentChapterValue);
713 fillErrorEventArgs.Errors = e;
717 if (fillErrorEventArgs.
Errors !=
null)
719 throw fillErrorEventArgs.
Errors;
725 [RequiresUnreferencedCode(
"IDataReader's (built from adapter commands) schema table types cannot be statically analyzed.")]
733 for (
int i = 0; i < tables.Length; i++)
735 if (tables[i] == newTable)
741 for (
int j = 0; j < tables.Length; j++)
743 array[j] = tables[j];
745 array[tables.Length] = newTable;
static ? object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture)
static ArgumentOutOfRangeException InvalidLoadOption(LoadOption value)
static ArgumentNullException ArgumentNull(string parameter)
static ArgumentOutOfRangeException InvalidSchemaType(SchemaType value)
static Exception FillSchemaRequiresSourceTableName(string parameter)
static void TraceExceptionForCapture(Exception e)
static NotSupportedException NotSupported()
static Exception InvalidMaxRecords(string parameter, int max)
static Exception FillRequires(string parameter)
static ArgumentOutOfRangeException InvalidMissingSchemaAction(MissingSchemaAction value)
static Exception FillRequiresSourceTableName(string parameter)
static bool IsCatchableExceptionType(Exception e)
static ArgumentOutOfRangeException InvalidMissingMappingAction(MissingMappingAction value)
static void CheckArgumentLength(string value, string parameterName)
static Exception InvalidStartRecord(string parameter, int start)
static DataTable[] AddDataTableToArray(DataTable[] tables, DataTable newTable)
FillErrorEventHandler? FillError
void ResetFillLoadOption()
int FillLoadDataRowChunk(SchemaMapping mapping, int startRecord, int maxRecords)
DataTableMappingCollection _tableMappings
MissingSchemaAction MissingSchemaAction
void CloneFrom(DataAdapter from)
virtual bool ShouldSerializeFillLoadOption()
virtual DataTable[] FillSchema(DataSet dataSet, SchemaType schemaType, string srcTable, IDataReader dataReader)
virtual bool ShouldSerializeAcceptChangesDuringFill()
virtual IDataParameter[] GetFillParameters()
virtual void OnFillError(FillErrorEventArgs value)
bool _continueUpdateOnError
bool _hasFillErrorHandler
ITableMappingCollection IDataAdapter. TableMappings
MissingSchemaAction _missingSchemaAction
bool _returnProviderSpecificTypes
void OnFillErrorHandler(Exception e, DataTable dataTable, object[] dataValues)
virtual bool ShouldSerializeTableMappings()
virtual int Fill(DataSet dataSet, string srcTable, IDataReader dataReader, int startRecord, int maxRecords)
virtual ? DataTable FillSchema(DataTable dataTable, SchemaType schemaType, IDataReader dataReader)
object FillSchemaFromReader(DataSet dataset, DataTable datatable, SchemaType schemaType, string srcTable, IDataReader dataReader)
virtual DataTable[] FillSchema(DataSet dataSet, SchemaType schemaType)
virtual int Update(DataSet dataSet)
static int s_objectTypeCount
virtual int Fill(DataSet dataSet)
virtual bool ReturnProviderSpecificTypes
static readonly object s_eventFillError
DataAdapter(DataAdapter from)
LoadOption _fillLoadOption
int FillFromReader(DataSet dataset, DataTable datatable, string srcTable, DataReaderContainer dataReader, int startRecord, int maxRecords)
DataTableMappingCollection TableMappings
SchemaMapping FillMappingInternal(DataSet dataset, DataTable datatable, string srcTable, DataReaderContainer dataReader, int schemaCount, DataColumn parentChapterColumn, object parentChapterValue)
virtual int Fill(DataTable[] dataTables, IDataReader dataReader, int startRecord, int maxRecords)
LoadOption FillLoadOption
bool AcceptChangesDuringFill
DataTableMapping GetTableMappingBySchemaAction(string sourceTableName, string dataSetTableName, MissingMappingAction mappingAction)
bool _acceptChangesDuringFill
int IndexOfDataSetTable(string dataSetTable)
SchemaMapping FillMapping(DataSet dataset, DataTable datatable, string srcTable, DataReaderContainer dataReader, int schemaCount, DataColumn parentChapterColumn, object parentChapterValue)
bool ContinueUpdateOnError
virtual DataAdapter CloneInternals()
static string GetSourceTableName(string srcTable, int index)
bool _acceptChangesDuringUpdateAfterInsert
int FillFromReader(DataSet dataset, DataTable datatable, string srcTable, DataReaderContainer dataReader, int startRecord, int maxRecords, DataColumn parentChapterColumn, object parentChapterValue)
virtual int Fill(DataTable dataTable, IDataReader dataReader)
bool _acceptChangesDuringUpdate
bool FillNextResult(DataReaderContainer dataReader)
int FillLoadDataRow(SchemaMapping mapping)
override void Dispose(bool disposing)
virtual DataTableMappingCollection CreateTableMappings()
MissingMappingAction _missingMappingAction
bool AcceptChangesDuringUpdate
ITableMapping ITableMappingCollection. Add(string sourceTableName, string dataSetTableName)
int IndexOfDataSetTable(string? dataSetTable)
static ? DataTableMapping GetTableMappingBySchemaAction(DataTableMappingCollection? tableMappings, string sourceTable, string dataSetTable, MissingMappingAction mappingAction)
static readonly DataCommonEventSource Log
static DataReaderContainer Create(IDataReader dataReader, bool returnProviderSpecificTypes)
void LoadDataRowWithClear()
DataReaderContainer DataReader
static void SuppressFinalize(object obj)
static CultureInfo InvariantCulture
static int Increment(ref int location)
DesignerSerializationVisibility
delegate void FillErrorEventHandler(object sender, FillErrorEventArgs e)
DynamicallyAccessedMemberTypes