Fill Method

Adds or refreshes rows in a DataSet or DataTable object with data from the database.

Syntax 1

int Fill( DataSet dataSet )

Syntax 2

int Fill( DataSet dataSet, string srcTable )

Syntax 3

int Fill( DataSet dataSet, int startRecord, int maxRecords, string srcTable )

Syntax 4

int Fill( DataTable dataTable )

Parameters

Return Value

The number of rows successfully added or refreshed in the DataSet.

Usage

  • Even if you use the StartRecord argument to limit the number of records that are copied to the DataSet, all records in the AseDataAdapter 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 AseDataReader when a read-only, forward-only result set is sufficient, perhaps with SQL statements (ExecuteNonQuery) to carry out modifications. Another alternative is to write a stored procedure that returns only the result you need.

  • If SelectCommand does not return any rows, no tables are added to the DataSet, and no exception is raised.

See also

.NET Framework documentation for DdDataAdapter.fill() for the list of supported fill methods.