View Single Post

  #3 (permalink)  
Old 02-16-2006
andrejd 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);

                        }

                    }
                }
Reply With Quote