ProfileContext.CreateProfile (Int32, String) Method (BCL)

Use this method to create a new profile object instance with the specified primary key value (as a string) and profile definition.

[Visual Basic .NET]

Public Function CreateProfile( _ByValkeyValue As System.Int32, _
  ByValprofileType As System.String _
) As Profile

[C#]

public Profile CreateProfile(System.Int32keyValue,
  System.StringprofileType);

Parameters

[Visual Basic .NET]

  • keyValue
    The value of the primary key property.
  • profileType
    The profile definition of interest, such as "UserObject", or "Organization".

[C#]

  • keyValue
    The value of the primary key property.
  • profileType
    The profile definition of interest, such as "UserObject", or "Organization".

Return Value

A handle to a newly created profile object.

Remarks

This method throws a CommerceProfileAlreadyExistsException exception if a profile instance with the specified primary key already exists. Note that this method only checks the local profile cache for existence of a profile with the provided key. The physical profile store is not checked until the Update method is called to commit the new profile instance to the store. For any other failure, it throws a CommerceProfileSystemException exception that wraps an inner COMException exception that contains an error code and description describing in more detail the nature of the failure.

Requirements

Namespace: Microsoft.CommerceServer.Runtime.Profiles

Platforms: Windows 2000, Windows Server 2003

Assembly: Microsoft.CommerceServer.Runtime.dll

See Also

Code to Build a Login Page

Code to Create and Set Profile Properties

Code to Retrieve and Display Profile Properties

Code to Use the SiteTerm Class

Copyright © 2005 Microsoft Corporation.
All rights reserved.