Address.PrimaryCity Property
Address.PrimaryCity Property
The name of the city of an address.
Public PrimaryCity As System.String
[C#]
public System.String PrimaryCity;
Remarks
The bold portion of the following address is the PrimaryCity property:
"1 Microsoft Way, Redmond, WA 98052, United States"
Maximum string size is 49 characters.
Example
[Visual Basic]
'Set up the address and specification
Dim myAddress As New Address()
myAddress.AddressLine = "127 George St."
myAddress.SecondaryCity = "Edinburgh"
myAddress.CountryRegion = "United Kingdom"
myAddress.PostalCode = "EH2 4JN"
Dim findAddressSpec As New FindAddressSpecification()
findAddressSpec.InputAddress = myAddress
findAddressSpec.DataSourceName = "MapPoint.EU"
'Declare the return variable, 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#]
//Set up the Address object and the specification object
//Set up the address and specification
Address myAddress = new Address();
myAddress.AddressLine = "127 George St.";
myAddress.SecondaryCity = "Edinburgh";
myAddress.CountryRegion = "United Kingdom";
myAddress.PostalCode = "EH2 4JN";
FindAddressSpecification findAddressSpec = new FindAddressSpecification();
findAddressSpec.InputAddress = myAddress;
findAddressSpec.DataSourceName = "MapPoint.EU";
//Declare the return variable, 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 | Address.SecondaryCity Property