Share via


AppConfig.GetRegionNameFromCountryCodeAndRegionCode Method (PIA)

Use this method to get the name of the state/province associated with the specified country/region code and state/province code.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Configuration
…
Public Function GetRegionNameFromCountryCodeAndRegionCode(bstrCountryCode As String,
  bstrStateCode As String) As String

[C#]

using Microsoft.CommerceServer.Interop.Configuration;
…
public string GetRegionNameFromCountryCodeAndRegionCode(
stringbstrCountryCode,
  stringbstrStateCode);

Parameters

[Visual Basic .NET]

  • bstrCountryCode
    A String that contains the code of the country/region for which the state/province name is being requested.
  • bstrStateCode
    A String that contains the code of the state/province within the specified country/region for which the state/province name is being requested.

[C#]

  • bstrCountryCode
    A string that contains the code of the country/region for which the state/province name is being requested.
  • bstrStateCode
    A string that contains the code of the state/province within the specified country/region for which the state/province name is being requested.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns a String that contains the state/province name. If the state/province name is not found, the String will contain the state/province code specified in the bstrStateCode parameter.

[C#] This method returns the state/province name. If the state/province name is not found, the returned string will contain the state/province code specified in the bstrStateCode parameter.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

Remarks

If the state/province name is not found, this method returns the state/province code specified in the bstrStateCode parameter.

Country/region codes, country/region names, state/province codes, and state/province names may be set in Commerce Server Business Desk.

[Visual Basic .NET]

Example

' oAppCfg is a Commerce.AppConfig object, sResult is a String
sResult = oAppCfg.GetRegionNameFromCountryCodeAndRegionCode("us",  "UT")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Configuration

Platforms: Windows 2000, Windows Server 2003

Assembly: apphelperlib (in apphelperlib.dll)

See Also

AppConfig Class

AppConfig.GetCountryCodeFromCountryName

AppConfig.GetCountryNamesList

AppConfig.GetRegionCodeFromCountryCodeAndRegionName

AppConfig.GetRegionNamesListFromCountryCode

Table of Country/Region Names and Codes

Copyright © 2005 Microsoft Corporation.
All rights reserved.