This document is archived and information here might be outdated.  Recommended version.


IWorkspace Interface (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (GeoDatabase)  

IWorkspace Interface

Provides access to members that have information about the workspace.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Description
Read-only property ConnectionProperties The connection properties of the workspace.
Read-only property DatasetNames The DatasetNames in the workspace.
Read-only property Datasets The datasets in the workspace.
Method ExecuteSQL Executes the specified SQL statement.
Method Exists Checks if the workspace exists.
Method IsDirectory TRUE if the workspace is a file system directory.
Read-only property PathName The file system full path of the workspace.
Read-only property Type The Type of the Workspace.
Read-only property WorkspaceFactory The factory that created the workspace.

CoClasses that implement IWorkspace

CoClasses and Classes Description
AMSWorkspace (esriTrackingAnalyst) Controls the Tracking Server workspace COM object's properties.
NetCDFWorkspace (esriDataSourcesNetCDF) The NetCDF workspace object.
RasterWorkspace (esriDataSourcesRaster) The raster workspace object.
Sde3Workspace (esriDataSourcesGDB) Esri SDE (3.x) Feature Database.
Sde4Workspace (esriDataSourcesGDB) Esri SDE (4.x) Feature Database.
SqlWorkspace (esriDataSourcesGDB) Sql workspace
VersionedWorkspace VersionedWorkspace Object.
Workspace Workspace Object.

Remarks

A Workspace is a container of spatial and non-spatial datasets such as feature classes, raster datasets, and tables. It provides methods to instantiate existing datasets and to create new datasets. Workspaces are classified into types specified by the esriWorkspaceType enumerator; FileSystemWorkspace, LocalDatabaseWorkspace, and RemoteDatabaseWorkspace.

Shapefiles and ArcGIS for Desktop Advanced workspaces are examples of FileSystemWorkspace. A personal geodatabase stored in an Access or a File Geodatabase is an example of a LocalDatabaseWorkspace. A geodatabase stored in an RDBMS such as Oracle, DB2, SqlServer, or Informix and accessed via ArcSDE is an example of a RemoteDatabaseWorkspace.

The WorkspaceName for a workspace can be persisted, for example, in a map document. An application can call the Open method on the workspace name after loading it from persistent storage in order to connect to and get an object reference to the workspace. A WorkspaceName name object can be returned from a workspace through the use of IDataset.FullName.

The IWorkspace interface provides methods for accessing various properties of a workspace, such as its connection properties, and the collection of datasets it contains.

See Also

IWorkspaceFactory Interface | IWorkspaceName Interface

.NET Snippets

Open Network Dataset | Set Data Source | Get FeatureClass From Shapefile On Disk | Add Tracking Layer To Map | Create Grid From Feature Class

.NET Samples

Closest facility solver (Code Files: frmClosestFacilitySolver) | Service area solver (Code Files: frmServiceAreaSolver) | Customizing schematic feature removal events (Code Files: FeatureRemovalMgmt) | Create a custom raster type (Code Files: TestThumbnailBuilder) | Location-allocation solver (Code Files: frmLocationAllocationSolver) | Utility wizard for basic schematic datasets configuration (Code Files: GenerateSchematicTemplate) | Vehicle routing problem solver (Code Files: frmVRPSolver) | Simple point plug-in data source (Code Files: OpenSimplePointDlg) | Origin-destination cost matrix solver (Code Files: frmODCostMatrixSolver) | Create a custom raster type from the ground up for DMCII data (Code Files: DMCIIRasterType TestDMCIIRasterType) | Implementing a schematic digitizing tool (Code Files: DockableDigit) | Extending the replication synchronization process (Code Files: RasterSyncWorkspaceExtension RegisterExtension) | Publish an image service and set configurations (Code Files: ISConfig) | Implementing associations between GIS features and schematic features (Code Files: ElementFeatureAssociation) | RSS weather GraphicTracker (Code Files: RSSWeather) | Create a Mosaic dataset (Code Files: CreateMosaicDataset) | Mosaic raster datasets to a file raster format (Code Files: CreateFileRasterMosaic) | Get and set key properties on a mosaic dataset (Code Files: GetSetKeyProperty) | Implementing the ISchematicRulesHelper to easily develop a custom schematic rule (Code Files: BisectorRule) | RSS weather layer (Code Files: AddWeatherItemTool RSSWeatherLayerClass) | Timestamper class extension (Code Files: TimestampClassExtension) | Create a custom NoData pixel filter (Code Files: TestApp) | Add and symbolize a historical temporal layer in ArcMap (Code Files: AddTemporalLayerButton) | Create an NDVI custom raster function (Code Files: NDVICustomFunction TestNDVICustomFunction) | Create a Function Raster dataset (Code Files: CreateFunctionRasterDataset) | Create a custom raster function (Code Files: TestWatermarkFunction WatermarkFunction) | Play back tracking data (Code Files: PlaybackDataButton) | Migrating from VB6 to VB .NET for ArcGIS 10 (Code Files: clscopy_table_sel)

.NET Related Topics

Assigning domains to fields | Cartographic representations | Connecting to geodatabases and databases | Converting data using GeoAnalyst objects | Converting simple data | Copying or loading data while preserving GlobalID values | Creating a topology in the geodatabase | Creating an address locator | Creating feature classes | Creating feature datasets | Creating fields | Creating geodatabases | Creating geometric networks within a geodatabase | Creating tables | Creating workspace extensions | Data processing in spatial analysis operations | DataSourcesGDB | DataSourcesOleDB | DataSourcesRaster | Editing with the geodatabase API | Executing a map algebra expression | Finding differences between versions | GeoAnalyst | GeoData services | Geodatabase | Geodatabase API best practices | GeoDatabaseUI | Getting a list of schema differences between replicas | How to access members that control the CAD drawing dataset | How to add a feature class or table to an existing replica | How to change label formats and marks on an axis using a line graph | How to connect to ArcGIS Tracking Server | How to convert a raster dataset to a JPEG2000 raster dataset | How to create a 3D pie graph | How to create a box plot graph | How to create a dynamic geocoded feature class | How to create a function series graph | How to create a histogram graph | How to create a Mosaic dataset | How to create a mosaic layer | How to create a referenced mosaic dataset | How to create a selection set using a scatter plot graph | How to create a vertical stack area graph | How to create an edit session | How to create an image server layer | How to create graph series with different color types | How to create multiple vertical bar graphs | How to export a dataset to XML | How to find the address closest to a point using reverse geocoding | How to geocode a single address | How to geocode a table of addresses | How to get CAD transformation properties (from, to, angle, and scale) | How to get the points of a two-point CAD transformation | How to import a dataset from XML | How to initialize a GeoDataServer object | How to listen to workspace edit events | How to open a Mosaic dataset | How to open a network dataset | How to open locator workspaces | How to rematch a geocoded feature class | How to return CAD drawing layer properties | How to return CAD transformation settings | How to save a function raster dataset into a raster dataset | How to save a mosaic dataset to a raster dataset | How to save raster data and set storage properties | How to set CAD transformation properties (from, to, angle, and scale) | How to set raster properties when saving as a raster | How to set the points of a two-point CAD transformation | How to sort data in the graph | How to split a raster dataset into multiple tiles | How to standardize an address | How to work with geocoding properties | Leveraging the schema cache | LocationUI | Managing edit sessions and edit operations | Migrating VB6 to VB.NET for ArcGIS 10 | Obtaining changes made in the current edit session | Performing a spatial analysis operation using objects | Pooling objects with server objects | Querying workspace properties | Updating attributes of existing features | Using ArcObjects as tool input | Using replica creation events to extend the replica creation process | Using the schema creator | Working with the analysis environment