ComponentOne DataObjects for .NET
Table Views in Virtual Mode
DataObjects for .NET (Enterprise Edition) > Virtual Mode – Dealing with Large Datasets > Table Views in Virtual Mode

One or more table views in a schema can be specified to function in virtual mode by setting their DataAccessMode property to Virtual, VirtualUnlimited, or VirtualAutomatic. We will call them virtual table views. For now, we will consider only Virtual mode. The other two, VirtualUnlimited and VirtualAutomatic, are variations that will be discussed a little later, in Asynchronous Fetch Modes.

A virtual rowset can contain an unlimited number of rows. For example, Tutorial 4 demonstrates a rowset containing 2.7 million rows that is available on the client with limited memory consumption and startup time of about three seconds.

When data is fetched from the database, a virtual table view fetches only an initial chunk (segment) of data. It can fetch other data segments from the server later, on its own accord, transparently to the user. Segment fetch is triggered by the end user repositioning to a row close to the end of the current segment, see When a Virtual Table View Fetches Data Segments.

At any given time, a virtual table view contains and exposes to the user a single contiguous segment of data, the current segment. The size of a data segment is specified by the VirtualSegmentSize property (default: 400 rows). The data exposed to the user in the C1DataTable object and in GUI controls bound to the virtual table view, is exactly the current segment, other segments (that may be fetched from the server, see When a Virtual Table View Fetches Data Segments) are kept internally and not exposed.

A virtual table view also maintains a segment cache containing a limited number of segments (controlled by the VirtualSegmentCount property, default: 4). The cache is inaccessible to the user. It is used internally for optimization, to avoid roundtrips to the server when possible.

Although a virtual table view exposes only one segment of data at a time, it automatically and transparently maintains continuity. So, for example, if the end user presses thePageDown key in a bound grid, or uses the MoveNext method to go beyond the current segment bounds, DataObjects for .NET will automatically adjust the current segment, fetching data from the server, if necessary, so the user will not notice the segment change. Fetching data and changing the current segment is done automatically, so the user perceives it as a continuous large rowset. Moreover, DataObjects for .NET uses a background asynchronous fetch technique to make fetching data from the server as much imperceptible to the user as possible, see When a Virtual Table View Fetches Data Segments.

If you navigate through a virtual table view using a bound grid, or programmatically using MoveNext and other methods of C1DataTableSource, the virtual rowset appears as a large continuous rowset. But it contains only one segment at a time on the client, so, if you use the C1DataTable object to access its data, you will see only limited number of rows.

Virtual mode table views fully support data modification. Modified rows are always visible, always kept in the current segment, and always accessible through the C1DataTable object (until Update, AcceptChanges or RejectChanges) – even if they were originally fetched in other segments.