DacPackage.Load Method (String, DacSchemaModelStorageType, FileAccess)
Load a package file specified by fileName.
Namespace: Microsoft.SqlServer.Dac
Assembly: Microsoft.SqlServer.Dac (in Microsoft.SqlServer.Dac.dll)
Syntax
'Declaration
Public Shared Function Load ( _
fileName As String, _
modelStorageType As DacSchemaModelStorageType, _
packageAccess As FileAccess _
) As DacPackage
'Usage
Dim fileName As String
Dim modelStorageType As DacSchemaModelStorageType
Dim packageAccess As FileAccess
Dim returnValue As DacPackage
returnValue = DacPackage.Load(fileName, _
modelStorageType, packageAccess)
public static DacPackage Load(
string fileName,
DacSchemaModelStorageType modelStorageType,
FileAccess packageAccess
)
public:
static DacPackage^ Load(
String^ fileName,
DacSchemaModelStorageType modelStorageType,
FileAccess packageAccess
)
static member Load :
fileName:string *
modelStorageType:DacSchemaModelStorageType *
packageAccess:FileAccess -> DacPackage
public static function Load(
fileName : String,
modelStorageType : DacSchemaModelStorageType,
packageAccess : FileAccess
) : DacPackage
Parameters
- fileName
Type: System.String
Path to the package file.
- modelStorageType
Type: Microsoft.SqlServer.Dac.DacSchemaModelStorageType
Backing storage type for package instance.
- packageAccess
Type: System.IO.FileAccess
The access in which to open the package. Valid values are Read or ReadWrite.
Return Value
Type: Microsoft.SqlServer.Dac.DacPackage
DacPackage instance that represents the package loaded from the specified file.
Exceptions
Exception | Condition |
---|---|
DacServicesException | If there is a problem reading the package; or if the package contains exported data. |