ProfileService.GetProfile

Ee825365.c++_on(en-US,CS.10).gifEe825365.vb_off(en-US,CS.10).gif

Use this method to retrieve the ProfileObject object corresponding to the specified primary key value and schema type.

Definition

Function GetProfile(sValue as Variant,bstrType As StringOptionalbReturnError As Boolean) As Object

Parameters

sValue

[in] A Variant that contains the primary key value.

bstrType

[in] A String that contains the profile schema type.

bReturnError

[in] An optional Boolean. The default value is True (-1).

Return Values

If this method completes successfully, it returns a ProfileObject object corresponding to the specified primary key value and schema name.

Error Values

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

Remarks

If the optional bReturnError parameter is set to True (-1) and the specified ProfileObject object is not found, an error message, E_PS_PROFILE_NOTEXISTS, is returned instead of a ProfileObject object.

If the bReturnError parameter is set to False (0) and the specified ProfileObject object is not found, an empty ProfileObject object is returned without an error message.

Properties with the IsCached attribute set to False are not loaded by this method.

The Fields property of the returned ProfileObject object provides access to the profile properties.

Use the GetProfileByKey method to retrieve a profile by specifying a key member name/value pair and schema type.

Call the Initialize method before you use this ProfileService method.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

' oProfileService is a Commerce ProfileService object
' oProfileObject is a Commerce ProfileObject object

oProfileObject = oProfileService.GetProfile("Joeuser@microsoft.com", _
 "UserObject")

See Also

ProfileService Object

ProfileService.GetProfileByKey

ProfileService.Initialize

ProfileObject Object

ProfileObject.Fields


All rights reserved.