CartCart
 
Check Out Check Out
Assisted Solutions, Inc. Assisted Solutions
Technology Done Right
 
 
 
 
 
 
 
A Service of Data Research Group | View Purchase History
Free Components
Free Components

City/State Finder

Overview

The CityStateFinder component is a class library that allows a developer to find city and state information for any given zip code. Utilizing the UPS XML web server, which is updated continually by the USPS AV database, the information is always up-to-date and as accurate as possible. The city and state retrieved will always be the same as on record with the United States Postal Service.

This component in accordance with standards for using the UPS XML Web Service, submits an AccessKey, UserID, and Password with every submission sent from the component. Currently, a generic AccessKey, UserID, and Password are embedded in the control which allows the developer to present nothing and do nothing but run the control. For development it is acceptable to simply use this, meaning that nothing needs to be added or done to the asp.net code. For all production software that is deployed however, an AccessKey, UserID, and Password must be retrieved from UPS via their web site. The UPS registration for such is free. See the picture to the right. To submit your registered AccessKey, UserID, and Password via the component, you will need to write several lines into the Web.config file of your asp.net application. The code is as follows:

<appSetting>
<add key="CSF_AccessKey"
value="GX223R4572DF7H38721"
/>
<add key="CSF_UserID"
value="jonsmith"
/>
<add key="CSF_Password"
value="abc123"
/>
</appSetting>

Again, registering at the UPS web site and entering the above information into your Web.config is not necessary to make the component work, but should be done for all deployed applications. In particular, this component has two classes that are important. The first is the CityStateFinder class which a simple SearchOn method. The second class is used to catch the output from the SearchOn method and is called CityStateLocations. A developer can implement this component in less than five lines of code. The following is an example of how it is used.

Dim locations() As CityStateLocations = CityStateFinder.SearchOn("90210", True)

In this example, the SearchOn method will search for the zip code "90210" and return an array of CityStateLocations. The SearchOn method is overloaded with a second parameter that may be used. This parameter is of type boolean, and denotes whether the returned locations should be in proper case alphabetically. Listed below are all the methods are properties that are implemented with this control.

CityStateFinder Methods
SearchOn Overloaded. Accepts either a zip code string to search on, or a zip code string and a proper case boolean. Returns an array of type CityStateLocations.
CityStateLocation Properties
City Gets, as string, the City part of the location that is returned.
Quality Gets, as double, the Quality of the location that is returned. This is determined by the web service.
Rank Gets, as integer, the Rank or probable order of the location that is returned. It is always good to use Rank 1.
StateAbbreviation Gets, as string, the State part of the location that is returned. Sets the format as a two letter abbreviation.
StateName Gets, as string, the State part of the location that is returned. Sets the format as fully spelled out.
Cost
This ASP.NET server control is free.
Copyright Agreement
Product: CityStateFinder
Release: 1.0 (12.13.03)

Company: Data Research Group
Programmer: Paul C. Waldschmidt

This component has been copyrighted by Data Research Group. It is not to be altered or distributed, except as part of an application. You are free to use it in any application, provided all copyright notice(s) are left unchanged. This product MAY NOT be sold for re-sale at any time by any organization or group without the express permissions of Data Research Group. This component is distributed "AS IS" with no warranty expressed or implied.
City/State Finder Info
Current Version:1.0
Release Date:11/07/2006

Download City/State Finder
City/State Finder Support Forums
Merchant Services
     
SSL Certificates