Contents Index DeleteCommand property FillError event

ASA Programming Guide
  Adaptive Server Anywhere .NET Data Provider API Reference
    AsaDataAdapter class

Fill method


Description 

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 

dataSet    A DataSet to fill with records and optionally schema.

srcTable    The name of the source table to use for table mapping.

startRecord    The zero-based record number to start with.

maxRecords    The maximum number of records to be read into the DataSet.

dataTable    A DataTable to fill with records and optionally schema.

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

Getting data using the AsaDataAdapter object


Contents Index DeleteCommand property FillError event