Share via


Add Contacts

The Add Contacts sample is a Microsoft® Windows® application that shows how to automate the process of adding a list of users to each other’s contact lists. All users in the list must already be provisioned for MapPoint Location Server.

Running the Sample in Visual Studio .NET 2003

Note   You must install the MapPoint Location Server Management API assemblies along with the Microsoft .NET Framework version 1.1 on your development computer to run this sample. For more information about requirements, see MapPoint Location Server Application Development Requirements.

To run the sample

  1. In Microsoft Visual Studio® .NET, on the File menu point to New, and then click Project.

  2. In the left pane of the New Project dialog box, click Visual Basic Projects or Visual C# Projects, and then click the Windows Application template.

  3. In the Name field, change WindowsApplication1 to AddContacts, and then click OK.

  4. On the Project menu, click Add Existing Item.

  5. Navigate to the appropriate project subfolder in the Add Contacts folder, select All Files in the Files of type dialog box, and then select all available files.

    • The default location for Visual Basic .NET project files is:
      Program Files\Microsoft MapPoint Location Server SDK, Version 1.0\Samples\Add Contacts\vb.
    • The default location for Visual C# .NET project files is:
      Program Files\Microsoft MapPoint Location Server SDK, Version 1.0\Samples\Add Contacts\cs.

    Note  When prompted, replace any existing files.

  6. Delete the default windows form, Form1, from the project.

  7. In Solution Explorer, right-click References and then click Add Reference.

  8. In the AddReference dialog box, click Browse, and then add the following assemblies:

    • Microsoft.MapPoint.LocationServer.Management.dll
    • Microsoft.MapPoint.LocationServer.Types.dll
    • Microsoft.MapPoint.LocationServer.Core.dll
  9. Edit the SampleContactUser.txt file located in your project folder and enter domain and alias pairs for provisioned users. These users are added to each other's contact lists when the program runs.

  10. On the Debug menu, click Start.

  11. When the application is running, click Select to select the text file you modified in step 9.

  12. In SQL Server, type the name of the computer that hosts the MapPoint Location Server database.

  13. In DB Name, type the name of the MapPoint Location Server database.

  14. Click Add Contacts to run the application.

See Also

Sample Code