Skip to main content

Direct and Disconnected Access

ADO.NET provides two different styles of data access. The Caché Managed Provider (CMP) fully supports both styles.

  1. Direct — Using the CacheCommand and CacheDataReader classes, the application opens a connection to Caché and execute queries and stored procedures on the data source.

  2. Disconnected — Create a DataSet object constituting an in memory cache of data. Use DataAdapter objects to fill the DataSet. The data can be drawn from a variety of sources, including databases, web services, text, and XML files. The application manipulates the data in the DataSet. The DataSet uses the DataAdapter objects to migrate any updates back to the data sources.

There are a number of factors to consider when deciding which approach to use. Here are the general tradeoffs:

  • The Direct style is more efficient in terms of speed and application resources.

  • The Disconnected style decouples the application from the data sources, so it provides greater flexibility in the application design.

This tutorial covers both styles. It provides several discrete examples of the Direct style. The tutorial's example application, Phonebook, uses the Disconnected style.

Note:

For more information on ADO.NET data access and a discussion of when to use Direct and Disconnected access, see ADO.NET ArchitectureOpens in a new tab in the .NET Framework Developer's Guide.

FeedbackOpens in a new tab