ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Data Namespace / FileSystemDatastoreType Enumeration
Example Example

In This Topic
    FileSystemDatastoreType Enumeration
    In This Topic
    Specifies the type of file-system data store.
    Syntax
    public enum FileSystemDatastoreType : System.Enum, System.IComparable, System.IConvertible, System.IFormattable  
    Public Enum FileSystemDatastoreType 
       Inherits System.Enum
       Implements System.IComparable, System.IConvertible, System.IFormattable 
    Members
    MemberDescription
    Cad CAD file.
    Raster Raster.
    Shapefile Shapefile.
    Example
    Opening a FeatureClass from a ShapeFile Datastore
    public async Task OpenShapefileFeatureClass()
    {
      await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
      {
        var fileConnection = new FileSystemConnectionPath(new Uri("path\\to\\folder\\containing\\shapefiles"), FileSystemDatastoreType.Shapefile);
        using (FileSystemDatastore shapefile = new FileSystemDatastore(fileConnection))
        {
          FeatureClass taxLotsFeatureClass = shapefile.OpenDataset<FeatureClass>("TaxLots");
          FeatureClass manHolesFeatureClass = shapefile.OpenDataset<FeatureClass>("ManHoles.shp"); // Can use the .shp extension, but its not needed.
          Table taxDetailsTableWithoutExtension = shapefile.OpenDataset<Table>("TaxDetails");
          Table taxDetailsTable = shapefile.OpenDataset<Table>("TaxDetails.dbf");
        }
      });
    }
    Opening a CAD Datastore
    public async Task OpenCADFeatureClass()
    {
      await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
      {
        var fileConnection = new FileSystemConnectionPath(new Uri("path\\to\\folder\\containing\\CAD"), FileSystemDatastoreType.Cad);
        using (FileSystemDatastore cadDatastore = new FileSystemDatastore(fileConnection))
        {
          // note - extension is required
          var cadDataset = cadDatastore.OpenDataset<FeatureClass>("hatchplayboundaries.dwg");
          // take note of the pattern for referencing a feature class. 
          var cadfeatureClass = cadDatastore.OpenDataset<FeatureClass>("hatchplayboundaries.dwg:Polyline");
    
          int numRows = 0;
          using (var cursor = cadfeatureClass.Search())
          {
            while (cursor.MoveNext())
              numRows++;
          }
        }
      });
    }
    Open raster dataset in a folder
    // Create a FileSystemConnectionPath using the folder path.
    FileSystemConnectionPath connectionPath = new FileSystemConnectionPath(new System.Uri(@"C:\Temp"), FileSystemDatastoreType.Raster);
    // Create a new FileSystemDatastore using the FileSystemConnectionPath.
    FileSystemDatastore dataStore = new FileSystemDatastore(connectionPath);
    // Open the raster dataset.
    RasterDataset fileRasterDataset = dataStore.OpenDataset<RasterDataset>("Sample.tif");
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             ArcGIS.Core.Data.FileSystemDatastoreType

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also