DataAdapter.Fill Method (DataTable, IDataReader)

Adds or refreshes rows in the DataTable to match those in the data source using the DataTable name and the specified IDataReader.

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

protected virtual int Fill (
	DataTable dataTable,
	IDataReader dataReader
protected int Fill (
	DataTable dataTable, 
	IDataReader dataReader
protected function Fill (
	dataTable : DataTable, 
	dataReader : IDataReader
) : int
Not applicable.



A DataTable to fill with records.


An instance of IDataReader.

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 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

Community Additions