Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 4 of 4

Extracting Zips form the territory (from code)

This is a discussion on Extracting Zips form the territory (from code) within the MapPoint Desktop Discussion forums, part of the Map Forums category; When I add a territory (select couple of zip codes into a new territory) interactively using the active X control, ...

  1. #1
    andrejd is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    2

    Extracting Zips form the territory (from code)

    When I add a territory (select couple of zip codes into a new territory) interactively using the active X control, how can I find the definition of that territory and a list of associated zip codes from my code?

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    Never done this. But I dont understeand what you ask. Can you explain with a few lines of code ?

  3. #3
    andrejd is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    2

    Resolved.....

    What I want to do is create a territory based on the zip codes using interactive methods, directly on the map, and then to be able to read the zip codes that make the territory from my program. In the meantime, I figured it out and here is the code:

    Code:
                    foreach (MapPoint.DataSet dset in mp.DataSets)
                    {
                        string st;
                        st = dset.Name;
                        if (dset.DataMapType ==  MapPoint.GeoDataMapType.geoDataMapTypeTerritory)
                        {
    
                            MapPoint.Recordset rset;
                            
                            string results ="";
    
                            if (dset.RecordCount > 0)
                            {
                                rset = dset.QueryAllRecords();
                                rset.MoveFirst();
                                while (!rset.EOF)
                                {
                                    foreach (MapPoint.Field fld in rset.Fields)
                                    {
                                        results += fld.Value.ToString() + " ";
                                    }
                                    results += "\r\n";
                                    rset.MoveNext();
                                }
                                System.Windows.Forms.MessageBox.Show(results);
    
                            }
    
                        }
                    }

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    thanks for feedback. I have put your code into code tags to make it more readable for others.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How can I get the territory code that a pushipin is located
    By paf33 in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 06-08-2006, 05:45 AM
  2. Extracting the corresponding Territory to a PushPin Location
    By jpendegraft in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 08-13-2005, 03:06 AM
  3. Send zip code & distance, receive list of zips back?
    By morfy50 in forum Bing Maps and MapPoint Web Service
    Replies: 1
    Last Post: 08-02-2005, 08:34 AM
  4. territory zip code capture
    By ToddF in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-01-2004, 03:17 PM
  5. extracting territory info from MapPoint
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 05-07-2004, 07:42 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25