Interface IDataset
- Namespace
- ESRI.ArcGIS.Geodatabase
- Assembly
- ESRI.Server.Geodatabase.dll
Provides access to members that supply dataset information.
[Guid("2D04C042-7766-11D0-B77D-00805F7CED21")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IDataset
Remarks
Not all of the methods and properties of IDataset are applicable to every type of dataset. For example, the Copy method should only be used on datasets from file-based data sources, and very few datasets will return values from the PropertySet property (coverages being a notable exception).
// Get the Utility Network dataset from a map server
private void GetUtilityNetworkDataset()
{
MapServer mapService = (MapServer)serverObjectHelper.ServerObject;
IMapServerDataAccess mapServerDataAccess = (IMapServerDataAccess)serverObjectHelper.ServerObject;
// Check if this service contains a Utility Network layer
var unLayerInfo = GetUNLayerInfo(mapService);
if (unLayerInfo != null)
{
// Get the Utility Network dataset
IDataset unDataset = (IDataset)mapServerDataAccess.GetDataSource(mapService.DefaultMapName, unLayerInfo.ID);
logger.LogMessage(ServerLogger.msgType.infoStandard, soe_name + ".init()", 200, "UN dataset found: " + unDataset.Name);
}
}
private IMapLayerInfo GetUNLayerInfo(IMapServer mapService)
{
IMapServerInfo mapServerInfo = mapService.GetServerInfo(mapService.DefaultMapName);
IMapLayerInfos layerInfos = mapServerInfo.MapLayerInfos;
for (int i = 0; i < layerInfos.Count; i++)
{
IMapLayerInfo layerInfo = layerInfos.Element[i];
if (layerInfo.Type.Equals("Utility Network Layer", StringComparison.OrdinalIgnoreCase))
{
return layerInfo;
}
}
return null;
}
Properties
BrowseName
The browse name of the dataset.
string BrowseName { get; set; }
Property Value
Remarks
Category
The category of the dataset.
string Category { get; }
Property Value
Remarks
IDataset::Category returns a description of the category of the dataset. The description returned from the Category property is the same value that is displayed in the Type column within the Contents tab in ArcCatalog. The value will contain a description of the dataset such as "Topology" prefixed with a description of the type of workspace containing the dataset such as "File Geodatabase".
The description returned from IDataset::Category may change between releases of ArcGIS. In addition to this, returned strings are localized, meaning that code relying on a specific string being provided may fail when deployed with a different version of ArcGIS than it was developed with, or when deployed to a client using a different language than it was developed with.
FullName
The associated name object.
IName FullName { get; }
Property Value
Remarks
Name
The name of the Dataset.
string Name { get; }
Property Value
PropertySet
The set of properties for the dataset.
IPropertySet PropertySet { get; }
Property Value
Remarks
Examples of intrinsic properties for which explicit methods exist include the SpatialReference and the Extent methods available on the IGeoDataset interface. In most cases this PropertySet will be empty.
IDataset::PropertySet is not supported for Graph objects such as a Geometric Network.
Subsets
Datasets contained within this dataset.
IEnumDataset Subsets { get; }
Property Value
Remarks
IDataset::Subsets is not supported for Graph objects such as a Geometric Network. To return the feature classes contained in a Geometric Network, use the IFeatureClassContainer interface.
Type
The type of the Dataset.
esriDatasetType Type { get; }
Property Value
Remarks
Workspace
The workspace containing this dataset.
IWorkspace Workspace { get; }
Property Value
Remarks
<p>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 <b><a href="esriWorkspaceType.htm">esriWorkspaceType</a></b> 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, SQL Server, or Informix and accessed via ArcSDE is an example of a RemoteDatabaseWorkspace.</p> <p>A Workspace hands out a <b><a href="WorkspaceName.htm">WorkspaceName</a> </b>object as the value of its FullName property. For example, the WorkspaceName for a workspace can be persisted in a map document. An application can call the <b>Open()</b> method on the workspace name after loading it from persistent storage to connect to and get an object reference to the workspace.</p>
Methods
CanCopy()
True if this dataset can be copied.
bool CanCopy()
Returns
Remarks
The CanCopy, CanDelete, and CanRename properties are meant to be used in conjunction with the Copy, Delete, and Rename methods and signify whether a dataset is supported by these methods. For example, you may not delete a network feature class nor can you use the Copy method on a Geodatabase feature class. To copy Geodatabase datasets, including feature classes, geometric networks, topologies, etc., use the IGeoDBDataTransfer interface.
The CanCopy method is supported by:
- CAD Drawings
- Coverages
- DBase Tables
- Info Tables
- Raster Datasets
- SDC datasets
- SDC Network Datasets
- Shapefiles
- Shapefile Network Datasets
CanDelete()
True if this dataset can be deleted.
bool CanDelete()
Returns
Remarks
The CanCopy, CanDelete, and CanRename properties are meant to be used in conjunction with the Copy, Delete, and Rename methods and signify whether a dataset is supported by these methods. For example, you may not delete a network feature class nor can you use the Copy method on a Geodatabase feature class. To copy Geodatabase datasets, including feature classes, geometric networks, topologies, etc., use the IGeoDBDataTransfer interface.
CanRename()
True if this dataset can be renamed.
bool CanRename()
Returns
Remarks
The CanCopy, CanDelete, and CanRename properties are meant to be used in conjunction with the Copy, Delete, and Rename methods and signify whether a dataset is supported by these methods. For example, you may not delete or rename a network feature class nor can you use the Copy method on a Geodatabase feature class. To copy Geodatabase datasets, including feature classes, geometric networks, topologies, etc., use the IGeoDBDataTransfer interface.
Copy(string, IWorkspace)
Copies this dataset to a new dataset with the specified name.
IDataset Copy(string copyName, IWorkspace copyWorkspace)
Parameters
copyNamestringcopyWorkspaceIWorkspace
Returns
Remarks
IDataset::Copy should only be used with datasets from file-based data sources, such as shapefiles and coverages.
Delete()
Deletes this dataset.
void Delete()
Remarks
Certain feature classes, such as network and topology feature classes, cannot be deleted until their containing objects are deleted.
Rename(string)
Renames this Dataset.
void Rename(string Name)
Parameters
Namestring
Remarks
IDataset::Rename does not support the renaming of Graph objects such as a Geometric Network. In addition, certain feature classes, such as network feature classes, cannot be renamed.