This documentation is archived and is not being maintained.

DataAdapter.Fill Method (DataSet, String, IDataReader, Int32, Int32)

Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet and DataTable names.

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

Protected Overridable Function Fill ( _
	dataSet As DataSet, _
	srcTable As String, _
	dataReader As IDataReader, _
	startRecord As Integer, _
	maxRecords As Integer _
) As Integer
Dim dataSet As DataSet
Dim srcTable As String
Dim dataReader As IDataReader
Dim startRecord As Integer
Dim maxRecords As Integer
Dim returnValue As Integer

returnValue = Me.Fill(dataSet, srcTable, dataReader, startRecord, maxRecords)
protected int Fill (
	DataSet dataSet, 
	String srcTable, 
	IDataReader dataReader, 
	int startRecord, 
	int maxRecords
protected function Fill (
	dataSet : DataSet, 
	srcTable : String, 
	dataReader : IDataReader, 
	startRecord : int, 
	maxRecords : int
) : int
Not applicable.



A DataSet to fill with records.


A string indicating the name of the source table.


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 DataSet. This does not include rows affected by statements that do not return rows.

See the remarks for System.Data.Common.DataAdapter.Fill(System.Data.DataSet) for additional information.

Windows 98, Windows Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

.NET Compact Framework

Supported in: 2.0

XNA Framework

Supported in: 1.0