AdministrationMetadataCatalog.ImportPackage Method (String, String , PackageContents, String, Boolean, Guid)

Imports the model given in the XML into the Metadata Store using the specified package contents, setting, update model, and job ID.

Namespace:  Microsoft.SharePoint.BusinessData.Administration.Client
Assembly:  Microsoft.SharePoint.BusinessData.Administration.Client (in Microsoft.SharePoint.BusinessData.Administration.Client.dll)

Syntax

'Declaration
Public Function ImportPackage ( _
    xml As String, _
    <OutAttribute> ByRef errors As String(), _
    packageContents As PackageContents, _
    settingId As String, _
    updateModel As Boolean, _
    jobId As Guid _
) As Model
'Usage
Dim instance As AdministrationMetadataCatalog
Dim xml As String
Dim errors As String()
Dim packageContents As PackageContents
Dim settingId As String
Dim updateModel As Boolean
Dim jobId As Guid
Dim returnValue As Model

returnValue = instance.ImportPackage(xml, _
    errors, packageContents, settingId, _
    updateModel, jobId)
public Model ImportPackage(
    string xml,
    out string[] errors,
    PackageContents packageContents,
    string settingId,
    bool updateModel,
    Guid jobId
)

Parameters

  • xml
    Type: System.String

    The XML string from which to import the metadata model.

  • errors
    Type: []

    A list of the noncritical errors encountered during the import process.

  • settingId
    Type: System.String

    The identifier of the Metadata Store partition in which the properties, localized names and access control entries of the metadata objects will be created.

  • updateModel
    Type: System.Boolean

    If true, the model definition that was already in the store should be updated to contain only the external content types in the given XML. This method throws an exception if the model is not in the database. If false, the model is created for the first time, and this method throws an exception if the model already exists in the database. When the model is being updated, the external content types that were previously in the model are not deleted. The caller must clean them up separately.

  • jobId
    Type: System.Guid

    A GUID that is used to track this import process.

Return Value

Type: Microsoft.SharePoint.BusinessData.Administration.Client.Model
The imported model.

Exceptions

Exception Condition
ArgumentNullException

The xml parameter is a null reference (Nothing in Visual Basic).

PackageFormatException

The format of the metadata XML is invalid.

SerializationException

If you attempt to import a BDC model into the BDC Metadata Store when a model with the same name already exists.

See Also

Reference

AdministrationMetadataCatalog Class

AdministrationMetadataCatalog Members

ImportPackage Overload

Microsoft.SharePoint.BusinessData.Administration.Client Namespace