protected virtual int Fill(DataTable[] dataTables, int startRecord, int maxRecords, IDbCommand command, CommandBehavior behavior)
{
long logScopeId = DataCommonEventSource.Log.EnterScope("<comm.DbDataAdapter.Fill|API> {0}, dataTables[], startRecord, maxRecords, command, behavior={1}", ObjectID, behavior);
try
{
if ((null == dataTables) || (0 == dataTables.Length) || (null == dataTables[0]))
{
throw ADP.FillRequires("dataTable");
}
if (startRecord < 0)
{
throw ADP.InvalidStartRecord(nameof(startRecord), startRecord);
}
if (maxRecords < 0)
{
throw ADP.InvalidMaxRecords(nameof(maxRecords), maxRecords);
}
if ((1 < dataTables.Length) && ((0 != startRecord) || (0 != maxRecords)))
{
throw ADP.OnlyOneTableForStartRecordOrMaxRecords();
}
if (null == command)
{
throw ADP.MissingSelectCommand(ADP.Fill);
}
if (1 == dataTables.Length)
{
behavior |= CommandBehavior.SingleResult;
}
return FillInternal(null, dataTables, startRecord, maxRecords, null, command, behavior);
}
finally
{
DataCommonEventSource.Log.ExitScope(logScopeId);
}
}