Address.CountryRegion Property

The country or region name of an address. String.

Public Dim CountryRegion As String
    Member of [Namespace].Address

[C#]
public System.String CountryRegion
    Member of [Namespace].Address

Remarks

  • The bolded portion of the following address is a CountryRegion property:
  • Maximum string size is 44 characters.
  • The CountryRegion property can be set to a commonly used name for a country or region, or to the CountryRegionInfo.FriendlyName or CountryRegionInfo.OfficialName property. For example, "US," "USA," "U.S.A.," "United States," and "United States of America" are all recognized.
  • See CountryRegion Entity IDs for a table of FriendlyName and OfficialName properties.

Example

 
[Visual Basic]
'This example assumes that the service 
'instance 'findService' has already been created and 
'that the MapPoint Web Service namespace has been imported

'Set up the Address object and the specification object
Dim myAddress As New Address()
myAddress.AddressLine = "1 Microsoft Way"
myAddress.PrimaryCity = "Redmond"
myAddress.Subdivision = "WA"
myAddress.PostalCode = "98052"
myAddress.CountryRegion = "US"

Dim findAddressSpec As New FindAddressSpecification()
findAddressSpec.InputAddress = myAddress
findAddressSpec.DataSourceName = "MapPoint.NA"

'Declare the return variable and find the address
Dim foundAddressResults As FindResults
foundAddressResults = findService.FindAddress(findAddressSpec)
If (foundAddressResults.NumberFound = 1) Then
    Console.WriteLine(foundAddressResults.Results(0).FoundLocation.Entity.DisplayName)
Else
    Console.WriteLine("Zero or multiple results found")
End If

 
[C#]
//This example assumes that the service 
//instance 'findService' has already been created and 
//that the MapPoint Web Service namespace has been imported

//Set up the Address object and the specification object
Address myAddress =  new Address();
myAddress.AddressLine = "1 Microsoft Way";
myAddress.PrimaryCity = "Redmond";
myAddress.Subdivision = "WA";
myAddress.PostalCode = "98052";
myAddress.CountryRegion = "US";

FindAddressSpecification findAddressSpec = new FindAddressSpecification();
findAddressSpec.InputAddress = myAddress;
findAddressSpec.DataSourceName = "MapPoint.NA";

//Declare the return variable and find the address
FindResults foundAddressResults;
foundAddressResults = findService.FindAddress(findAddressSpec);
if (foundAddressResults.NumberFound == 1) 
{
    Console.WriteLine(foundAddressResults.Results[0].FoundLocation.Entity.DisplayName);
}
else
{
    Console.WriteLine("Zero or multiple results found");
}


 

See Also

Address Class | CountryRegionInfo.FriendlyName Property | CountryRegionInfo.OfficialName Property | CountryRegion Entity IDs