Adds or refreshes the specified range of rows into the named System.Data.DataTable of the specified System.Data.DataSet. The System.Data.DataTable named is created and added to the System.Data.DataSet if neccessary.
Visual Basic
Overloads Public Function Fill( _
ByVal dataSet As DataSet, _
ByVal startRecord As Integer, _
ByVal maxRecords As Integer, _
ByVal srcTable As String _
) As Integer
C#
public int Fill(
DataSet dataSet,
int startRecord,
int maxRecords,
string srcTable
);
dataSet A System.Data.DataSet to fill with records and optionally schema.
startRecord The zero-based record number with which to start.
maxRecords The maximum number of records to be read into the System.Data.DataSet. A value of 0 gets all records found after the start record.
srcTable The name of the source table to use for table mapping.
The number of rows successfully added or refreshed in the System.Data.DataSet.
Even if you use the startRecord argument to limit the number of records that are copied to the System.Data.DataSet, all records in the ULDataAdapter query are fetched from the database to the client. For large result sets, this can have a significant performance impact. An alternative is to use an ULDataReader when a read-only result set is sufficient, perhaps with SQL statements (ExecuteNonQuery) to carry out modifications. Another alternative is to use a ULTable that allows read-write access to the database.
If ULDataAdapter.SelectCommand does not return any rows, no tables are added to the System.Data.DataSet and no exception is raised.
For more information, see IDataAdapter.Fill.
ArgumentException - The startRecord or maxRecords parameter was less than zero.
System.ArgumentNullException - The dataSet or srcTable parameter is invalid.
InvalidOperationException - The ULDataAdapter.SelectCommand is invalid or, the table mapping is missing and ULDataAdapter.MissingMappingAction is set to System.Data.MissingMappingAction.Error or, the System.Data.DataTable is missing from the System.Data.DataSet and ULDataAdapter.MissingSchemaAction is set to System.Data.MissingSchemaAction.Error.