Share via


IProfileObject2::UpdateProfileXML Method

Use this method to change the properties of the ProfileObject object.

HRESULT IProfileObject2::UpdateProfileXML(
  BSTR bstrProfileXML,
  XMLFormatEnum eXMLFormat
);
Sub UpdateProfileXML(
    bstrProfileXML As String,
    eXMLFormat As XMLFormatEnum
)

Parameters

  • bstrProfileXML
    [C++]

    [in] A BSTR that contains the profile XML data.

    [Visual Basic]

    A String that contains the profile XML data.

  • eXMLFormat
    [C++]

    [in] An XMLFormatEnum enumeration that contains the XML format.

    [Visual Basic]

    An XMLFormatEnum enumeration that contains the XML format.

Return Value

[C++]

This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic]

None.

Error Values

The Errors property of the ProfileService object stores the collection of errors encountered in the last Profiles resource operation. For more information, see IProfileService::get_Errors.

Remarks

Use the Update method to commit the property changes to the data store.

This method updates the properties of the ProfileObject object with the values in the bstrProfileXML parameter. A partial update is allowed. All properties provided in the XML data will be updated.

bstrProfileXML must always contain the appropriate schema and data information, as defined by the return value of the IProfileObject.GetProfileXML method. When calling IProfileObject.GetProfileXML, be sure to use the RetrieveSchemaAndData enumeration option.

Properties that are marked as a join key cannot be updated. The following table shows the values in the XMLFormatEnum enumeration, their associated names, and describes their use.

Name

Value

Description

eInvalid

0

Reserved for future use.

eAttributeCentric

1

Attribute centric XML format.

eElementCentric

2

Element centric XML format.

Example

'sXMLProfile is a string containing:
'<User email="Joe@Cool.com" guid="123" creationDate="3/27/00" version="5" FavoriteColors="e1 e2">
'  <FavoriteColors id="e1">Red</FavoriteColors>
'  <FavoriteColors id="e2">Green</FavoriteColors>
'  <HomeAddress address="4149 Beach Drive" city="San Diego" state="CA"> 
'  </HomeAddress>
'  <SecureInfo password="*****" creditCard="1234565">
'  </SecureInfo>
'</User>

myProfileObject2.UpdateProfileXML(sXMLProfile, )

See Also

Other Resources

ProfileObject Object

IProfileObject2::get_Fields Property