ASA Programming Guide
Developing Applications with the .NET Data Provider
With the Adaptive Server Anywhere .NET data provider, there are two ways you can access data: using the AsaCommand object or using the AsaDataAdapter object.
AsaCommand object The AsaCommand object is the recommended way of accessing and manipulating data in .NET.
The AsaCommand object allows you to execute SQL statements that retrieve or modify data directly from the database. Using the AsaCommand object, you can issue SQL statements and call stored procedures directly against the database.
Within an AsaCommand object, the AsaDataReader is used to return read-only result sets from a query or stored procedure. The AsaDataReader returns only one row at a time, but this does not degrade performance because the Adaptive Server Anywhere client-side libraries use prefetch buffering to prefetch several rows at a time.
Using the AsaCommand object allows you to group your changes into transactions rather than operating in autocommit mode. When you use the AsaTransaction object, locks are placed on the rows so that other users cannot modify them.
For more information, see AsaCommand class and AsaDataReader class.
AsaDataAdapter object The AsaDataAdapter object retrieves the entire result set into a DataSet. A DataSet is a disconnected store for data that is retrieved from a database. You can then edit the data in the DataSet and when you are finished, the AsaDataAdapter object updates the database with the changes made to the DataSet. When you use the AsaDataAdapter, there is no way to prevent other users from modifying the rows in your DataSet. You need to include logic within your application to resolve any conflicts that may occur.
For more information about conflicts, see Resolving conflicts when using the AsaDataAdapter.
For more information about the AsaDataAdapter object, see AsaDataAdapter class.
There is no performance impact from using the AsaDataReader within an AsaCommand object to fetch rows from the database rather than the AsaDataAdapter object.
Using the AsaCommand object to retrieve and manipulate data
Using the AsaDataAdapter object to access and manipulate data
Obtaining primary key values
Handling BLOBs
Obtaining time values