This documentation is archived and is not being maintained.

DataAdapter.Fill Method (DataTable[], IDataReader, Int32, Int32)

Note: This method is new in the .NET Framework version 2.0.

Adds or refreshes rows in the DataSet to match those in the data source using the DataSet name, and creates a DataTable.

Namespace: System.Data.Common
Assembly: System.Data (in

Protected Overridable Function Fill ( _
	dataTables As DataTable(), _
	dataReader As IDataReader, _
	startRecord As Integer, _
	maxRecords As Integer _
) As Integer
Dim dataTables As DataTable()
Dim dataReader As IDataReader
Dim startRecord As Integer
Dim maxRecords As Integer
Dim returnValue As Integer

returnValue = Me.Fill(dataTables, dataReader, startRecord, maxRecords)
protected int Fill (
	DataTable[] dataTables, 
	IDataReader dataReader, 
	int startRecord, 
	int maxRecords
protected function Fill (
	dataTables : DataTable[], 
	dataReader : IDataReader, 
	startRecord : int, 
	maxRecords : int
) : int



A collection of DataTable objects to fill with records.


An instance of IDataReader.


An integer indicating the location of the starting record.


An integer indicating the maximum number of records.

Return Value

The number of rows successfully added to or refreshed in the DataTable. This does not include rows affected by statements that do not return rows.

See the remarks for Fill for additional information.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

.NET Compact Framework

Supported in: 2.0