MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Extracting Zips form the territory (from code)

This is a discussion on Extracting Zips form the territory (from code) within the MapPoint 2006/2009 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, ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-16-2006
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 02-16-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Hi,

Never done this. But I dont understeand what you ask. Can you explain with a few lines of code ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 02-16-2006
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);

                        }

                    }
                }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 02-17-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Hi,

thanks for feedback. I have put your code into code tags to make it more readable for others.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
code, extracting, form, territory, zips


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 10:27 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55