Export Territories

Rubinho
12-28-2006, 05:03 AM
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
********************************

Wilfried
12-28-2006, 10:07 AM
Hi,

Can you tell us what exacly you change to get the fields empty ?

Rubinho
12-28-2006, 04:22 PM
Hi,

Can you tell us what exacly you change to get the fields empty ?


The only thing I change is a territory. For example, Bill has a territory set to Paris and i add some cities around Paris into the territory

From that point, the recordset from the map dataset has lost his fields, so i cant loop anymore in it.
I can loop in the records of the recordset but not anymore in de fields of the recordset. Recordset.fieldcount = 0

Maybe there is someway to refresh the dataset ??
I really don't know

Wilfried
12-29-2006, 09:31 AM
Hi,

Possible the changes destroy the previous import. Maybe a workaround is to do it all programatically?

Rubinho
12-29-2006, 02:59 PM
Hi,

Possible the changes destroy the previous import. Maybe a workaround is to do it all programatically?

Well i'm looking for a workoaround for it. I tried to update my linked data source (txt file), but that doesn't work also.

Does somebody now another way to export my territory updates ?
If I have one, it's oke, then i'll program it that way

thx

 
Web mp2kmag.com
mapforums.com