Community of VE/MapPoint Users and Developers
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, ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Extracting Zips form the territory (from code) |
| |||
|
Hi, Never done this. But I dont understeand what you ask. Can you explain with a few lines of code ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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);
}
}
}
|
| |||
|
Hi, thanks for feedback. I have put your code into code tags to make it more readable for others.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| code, extracting, form, territory, zips |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |