ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Core.Data.Realtime Namespace / RealtimeDatastore Class / OpenTable Method
The name of the dataset to open.
Example

In This Topic
    OpenTable Method (RealtimeDatastore)
    In This Topic
    Gets a RealtimeTable or RealtimeFeatureClass instance associated with name. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public Table OpenTable( 
       string name
    )
    Public Function OpenTable( _
       ByVal name As String _
    ) As Table

    Parameters

    name
    The name of the dataset to open.

    Return Value

    Exceptions
    ExceptionDescription
    No valid real-time datastore has been opened prior to calling this operation.
    A realtime datastore related exception has occurred. For example, the name is invalid.
    This method or property must be called within the lambda passed to QueuedTask.Run.
    The data store does not support this operation.
    Example
    Connect to a real-time feature class from a real-time datastore
    var url = "https://geoeventsample1.esri.com:6443/arcgis/rest/services/AirportTraffics/StreamServer";
         
    await QueuedTask.Run(() =>
    {
      var realtimeServiceConProp = new RealtimeServiceConnectionProperties(
                                       new Uri(url),
                                       RealtimeDatastoreType.StreamService
                                    );
      using (var realtimeDatastore = new RealtimeDatastore(realtimeServiceConProp))
      {
        //A Realtime data store only contains **one** Realtime feature class (or table)
        var name = realtimeDatastore.GetTableNames().First();
        using (var realtimeFeatureClass = realtimeDatastore.OpenTable(name) as RealtimeFeatureClass)
        {
          //feature class, by default, is not streaming (opposite of the stream layer)
          realtimeFeatureClass.StartStreaming();
          //TODO use the feature class
          //...
        }
      }
    
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also