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);
}
}
}