spacer1
spacer2 1_1 1_2
2_1
 Subscribe
 The MP2K Update!
 
 
 
 Magazine
Front Cover
What's New
Articles
News
Sample Data
Gallery
Advertise
About
 Features
MapPoint 2013
Press Releases
MapPoint Forums
Companies
Link to MP2Kmag
Wish List
MapPoint Trial
Authors
 Earlier Content
Past News Items
Past What's New Announcements
 Sponsors
 Order

MapPoint 2013

Programming MapPoint in .NET

MapPoint Book

  Spatial Community
SVG Tutorials
MapPoint

Map Visitors

  MAPPOINT Q & A  

Top | Post New Question | Read All | MP2K Asks Microsoft

714 Philip - June 10, 2002

I am interfacing Mappoint with VB. I am plotting various points from a database. I want to be able to delete various pushpins. The problem is that some of the pushpins had the same name(i.e. same company name, just different locations) and when I go to delete them, the program crashes because there are two with the same name. Does anyone have an idea on how to correct this without having to go through the entire database and change the names?

Answers:
June 10, 2002
If you are plotting them individually, you could check to see if a name already exists before adding a new pushpin by using the FindPushpin method. If the name is already in use, add a tiebreaker number to the name and see if that exists. If not, add the pushpin. Otherwise repeat the tiebreaker process until you find a name that hasn't been used.

Of course, you could also add a unique counter field in your database (Identity column in SQL Server) and use it as part of your name like "Microsoft (1546)" where 1546 is the value of the counter column. That would ensure uniqueness.

- Walt Cygan

June 11, 2002
Thanks for your help.

Post New Answer / Follow-up


Google
 
MP2Kmag Internet


 Recent Discussion
 Resources


Want Your Site To Appear Here?

   © 1999-2012 MP2K. Questions and comments to: website@mp2kmag.com
  Microsoft and MapPoint 2002/2004/2006/2009/2010/2011/2013 are either trademarks or registered trademarks of Microsoft.