IProfileObject2::UpdateProfileXML Method [C++]

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

Definition

[C++]

HRESULT IProfileObject2::UpdateProfileXML(BSTRbstrProfileXML,
  XMLFormatEnumeXMLFormat);

[Visual Basic]

Sub UpdateProfileXML(bstrProfileXML As String,
  eXMLFormat As XMLFormatEnum)

Parameters

  • bstrProfileXML[C++]
    [in] A BSTR that contains the profile XML data.
  • bstrProfileXML[Visual Basic]
    A String that contains the profile XML data.
  • eXMLFormat[C++]
    [in] An XMLFormatEnum enumeration that contains the XML format.
  • eXMLFormat[Visual Basic]
    An XMLFormatEnum enumeration that contains the XML format.

Return Values

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

[Visual Basic] None.

Error Values

[C++] 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.

[Visual Basic] The Errors property of the ProfileService object stores the collection of errors encountered in the last Profiles resource operation. For more information, see ProfileService.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.

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.

[Visual Basic]

Example

'sXMLProfile is a string containing:

<?xml version="1.0"?>

<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, eAttributeCentric)

See Also

[C++]ProfileObject Object

[C++]IProfileObject2::get_Fields

[Visual Basic]ProfileObject Object

[Visual Basic]ProfileObject.Fields

Copyright © 2005 Microsoft Corporation.
All rights reserved.