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


IWorkspaceFactory.OpenFromFile Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IW > IWorkspaceFactory Interface > IWorkspaceFactory.OpenFromFile Method
ArcGIS Developer Help

IWorkspaceFactory.OpenFromFile Method

Opens the workspace specified by the given file name.

[Visual Basic .NET]
Public Function OpenFromFile ( _
    ByVal fileName As String, _
    ByVal hWnd As Integer _
) As IWorkspace
[C#]
public IWorkspace OpenFromFile (
    string fileName,
    int hWnd
);
[C++]
HRESULT OpenFromFile(
  BSTR fileName,
  OLE_HANDLE hWnd
);
[C++]
Parameters
fileName [in]

fileName is a parameter of type BSTR hWnd [in]
hWnd is a parameter of type OLE_HANDLE

Product Availability

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

Remarks

OpenFromFile takes the pathname of a file or directory that represents either a FileSystemWorkspace or LocalDatabaseWorkspace, or a connection file to a RemoteDatabase workspace and returns an interface on the specified workspace. Clients of these methods can then proceed to open and access datasets in the workspace. If these methods are called with insufficient properties, then the user will be presented with a connection dialog that will prompt for the required properties.

The hWnd argument is the parent window or application's window. The hWnd will guarantee that the connection dialog, if presented to you because of insufficient properties, has the correct parent.

See Also

IWorkspaceFactory Interface

.NET Samples

Closest facility solver Mosaic raster datasets to a file raster format Create a Function Raster dataset Create a Math Function Raster dataset Create a custom NoData pixel filter Create a custom raster function Create a custom raster function Create a custom raster type Create a custom raster type from the ground up for DMCII data Buffer snap agent Cut polygons without selection edit task Edit event listener Managing snap agents Custom reshape polyline edit task Custom vertex editing commands Get and set key properties on a mosaic dataset 3D dynamic element tracking Publish an image service and set configurations Location-allocation solver Create an NDVI custom raster function Create an NDVI custom raster function Origin-destination cost matrix solver Extending the replication synchronization process Route layer RSS weather GraphicTracker RSS weather layer Service area solver Simple point plug-in data source Add and symbolize a historical temporal layer in ArcMap Play back tracking data Vehicle routing problem solver