MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Move pins to dataset

This is a discussion on Move pins to dataset within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi all. I have a vb.net project that is going ok at the moment. I can pin all the data ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 08-28-2008
Junior Member
White Belt
 
Join Date: Aug 2008
Posts: 9
Move pins to dataset

Hi all.

I have a vb.net project that is going ok at the moment.

I can pin all the data from my sql that has a postcode.

I am looking to add an IF statement, so if the DivisionID is "North", move the pin to odsNorth (a dataset), or IF it is "South" move the pin to odsSouth.

Here is my code which will hopefully help you see what I'm jabbering on about

Code:
        If chkNorthDiv.Checked = True Then
            oMap.DataSets.AddPushpinSet("North Division")
            oDSNorth = oMap.DataSets("North Division")
            oDSNorth.Symbol = symbolNorth
        End If

        If chkSouthDiv.Checked = True Then
            oMap.DataSets.AddPushpinSet("South Division")
            oDSSouth = oMap.DataSets("South Division")
            oDSSouth.Symbol = symbolSouth
        End If


        For Each dr In dsData.Tables(0).Rows
            'If NULL data in Postcode, show message box and carry on
            If dr("PostCode") Is DBNull.Value Then
                sw.WriteLine("Null postcode value at " & dr("ServiceID") & " " & dr("Name"))
            Else
                'set FindResults to look for PostCode, not long/lat and plots Pins
                oFR = oMap.FindResults(dr("PostCode"))
                If oFR.Count > 0 Then

                    oPin = oMap.AddPushpin(oFR(1), dr("Name"))  'default balloon data unless specified from checkboxes



                    If dr("DivisionID") = "Div-N" Then
                        oPin.MoveTo(oDSNorth)
                    End If

                    If dr("DivisionID") = "Div-S" Then
                        oPin.MoveTo(oDSSouth)
                    End If


        Next
There is more stuff inside the loop but this is the essence.

I am not getting an error by the way. It is still pinning all the data, but keeping them in the default "My Pushpins"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 08-28-2008
Junior Member
White Belt
 
Join Date: Aug 2008
Posts: 9
Re: Move pins to dataset

After much reading I got there:
Code:
        oPin.MoveTo(oMap.DataSets.Item("North"))
Still think my theory of

Code:
        oPin.MoveTo(oDSNorth)
Works better though, because it just references the dataset name.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 09-09-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Re: Move pins to dataset

Hi,

No, it does not reference the dataset name, it reference the dataset itself. That is not the same.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
dataset, move, pins


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/move-pins-dataset-8356.html

Posted By For Type Date
The Magazine for MapPoint - MP2K Magazine This thread Refback 08-28-2008 01:50 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Move Shape - get new lat lon. tfmiltz MapPoint 2006/2009 Discussion 4 11-09-2007 09:51 AM
Disallow to move manuell added push pins Anonymous MapPoint 2006/2009 Discussion 1 03-02-2004 11:18 AM
not to move shapes Manuel MapPoint 2006/2009 Discussion 2 05-19-2003 02:46 PM
Help.! How to move a pushpin in the map. Anonymous MapPoint 2006/2009 Discussion 9 03-10-2003 06:00 PM
Ist it possible to get X, Y from mouse move blackmap MapPoint 2006/2009 Discussion 1 12-16-2002 04:54 PM


All times are GMT -5. The time now is 09:20 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54