ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Core.Data Namespace / MobileGeodatabaseConnectionPath Class
Members Example

In This Topic
    MobileGeodatabaseConnectionPath Class
    In This Topic
    Represents the physical path to a mobile geodatabase that ends with the .geodatabase extension.
    Syntax
    public sealed class MobileGeodatabaseConnectionPath : Connector 
    Public NotInheritable Class MobileGeodatabaseConnectionPath 
       Inherits Connector
    Example
    Opening a Mobile Geodatabase given the path
    {
      await QueuedTask.Run(() =>
      {
        // Opens a mobile geodatabase. This will open the geodatabase if the folder exists and contains a valid mobile geodatabase.
        using (Geodatabase mobileGeodatabase = new Geodatabase(new MobileGeodatabaseConnectionPath(new Uri(@"C:\Data\LocalGovernment.geodatabase"))))
        {
          Connector connector = mobileGeodatabase.GetConnector();
          if (connector is MobileGeodatabaseConnectionPath mobileConnPath)
          {
            // Get the type of the mobile geodatabase 
            MobileGeodatabaseType type = mobileConnPath.Type;
          }
        }
      });
    }
    Creating a Mobile Geodatabase
    {
      await QueuedTask.Run(() =>
      {
        // Create a MobileGeodatabaseConnectionPath with the name of the mobile geodatabase you wish to create
        MobileGeodatabaseConnectionPath mobileGeodatabaseConnectionPath =
          new MobileGeodatabaseConnectionPath(new Uri(@"C:\Path-To-Mobile-Geodatabase\YourName.geodatabase"));
    
        // Create and use the mobile geodatabase
        using (Geodatabase geodatabase = SchemaBuilder.CreateGeodatabase(mobileGeodatabaseConnectionPath))
        {
          // Create additional schema here
        }
      });
    }
    Deleting a Mobile Geodatabase
    {
      await QueuedTask.Run(() =>
      {
        // Create a MobileGeodatabaseConnectionPath with the name of the mobile geodatabase you wish to delete
        MobileGeodatabaseConnectionPath mobileGeodatabaseConnectionPath =
          new MobileGeodatabaseConnectionPath(new Uri(@"C:\Path-To-Mobile-Geodatabase\YourName.geodatabase"));
    
        // Delete the mobile geodatabase
        SchemaBuilder.DeleteGeodatabase(mobileGeodatabaseConnectionPath);
      });
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.Data.Connector
          ArcGIS.Core.Data.MobileGeodatabaseConnectionPath

    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also