View Single Post

  #1 (permalink)  
Old 12-28-2006
Rubinho Rubinho is offline
Junior Member
White Belt
 
Join Date: Nov 2006
Posts: 10
Question Export Territories

Hi all,

I Have the mappoint control in my vb.net application and i import on the fly
territories.
When I press F6, the territory manager appears and i can add/remove areas to
a territory

Now i want to export these territories (for updating my database).
I can do this with the code at the bottom of this message.
The problem i have is that it only works before i change something.
When i change something te fields in the recordset are empty.

Does somebody has a solution ?
I would very appreciate it.

********************************
For Each ds As MapPoint.DataSet In mp.ActiveMap.DataSets
If ds.DataMapType =
MapPoint.GeoDataMapType.geoDataMapTypeTerritory Then
Dim rset As MapPoint.Recordset
Dim results As String = ""
If ds.RecordCount > 0 Then
rset = ds.QueryAllRecords
rset.MoveFirst()
Do While Not rset.EOF
For Each fld As MapPoint.Field In rset.Fields
results += fld.Value.ToString() + " "
Next
results += vbCrLf
rset.MoveNext()
Loop
MsgBox(results)
End If
End If
Next
********************************
Reply With Quote