MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Custom DataSet and adding Pushpin???

This is a discussion on Custom DataSet and adding Pushpin??? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; There might be a better way of doing this (and if so please let me know). But what I am ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  4 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 03-10-2008
OOT OOT is offline
Junior Member
Yellow Belt
 
Join Date: Dec 2006
Posts: 14
Unhappy [Resolved!] Custom DataSet and adding Pushpin???

There might be a better way of doing this (and if so please let me know). But what I am wanting to do is separate my PushPins into separate DataSets. So instead of all of them being in "My Pushpins" I'll have a "Customers" PushPin set and a "Stores" PushPin set.

I'm working in Visual Basic 2005. In a module I've got this code:

Code:
Public mpStores As MapPoint.DataSet
On my Form_Load, I have this code:

Code:
mpStores = objMap.DataSets.AddPushpinSet("My Stores")
I have another procedure that hits a database that returns the Name, Latitude and Longitude of each Store. I loop though this code and output it my window and everything is accurate. However, when I run this code:

Code:
    Dim dt As DataTable = Nothing
    Dim objLoc As MapPoint.Location = Nothing
    Dim objPP As MapPoint.Pushpin = Nothing
    Dim objSym As MapPoint.Symbol = Nothing

    For i = 0 To dt.Rows.Count - 1

        objPP = objMap.AddPushpin(objLoc)
        objPP.Name = dt.Rows(i).Item("upName").ToString.Trim
        objSym = objMap.Symbols.Add(Application.StartupPath + "\images\" & dt.Rows(i).Item("upImage").ToString.Trim)
        objPP.Symbol = objSym.ID

        objPP.MoveTo(mpStores)

    Next
Stepping through the code everything seems to work fine until I get to the last line (objPP.MoveTo(mpStores)). That line creates the following error:

Quote:
Error: Value does not fall within the expected range.
I'm very very new to datasets and don't really understand if what I'm proposing is the best way. I would like to keep them separate unless it is a major issue.

Thank you in advance for any/all help/suggestions/idea's/thoughts/etc. It is very much appreciated.

Last edited by OOT; 03-10-2008 at 02:42 PM. Reason: because I'm an idiot
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 03-10-2008
OOT OOT is offline
Junior Member
Yellow Belt
 
Join Date: Dec 2006
Posts: 14
Re: Custom DataSet and adding Pushpin???

OK. My bad. I found the problem. The code I posted is working. But I was calling the database hit (which fills the new DataSet) before I instantiated the new DataSet (in Form_Load).

So now I'm going to go flush my head and then consider the appropriate method of hari-kari

I'm going to mark this resolved and then go hide in shame.

Self Esteem and Pride
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 03-10-2008
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 219
Re: Custom DataSet and adding Pushpin???

OOT,

This is a newsgroup and you showed some effort.
Nothing to feel bad about.

Mike Mattys
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 03-10-2008
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,318
Blog Entries: 1
Re: Custom DataSet and adding Pushpin???

Plus that is definitely the most creative use of Smilies here yet! I enjoyed reading..
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
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


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/custom-dataset-adding-pushpin-7271.html

Posted By For Type Date
MapPoint: Blogs, Photos, Videos and more on Technorati This thread Refback 04-10-2008 11:39 PM
Custom DataSet and adding Pushpin??? - MapPoint Forums This thread Refback 03-29-2008 08:56 AM
Calling MapPoint From C++ Without the MFC Safety Net - MapPoint Articles - MP2K Magazine This thread Refback 03-12-2008 06:23 PM
The Magazine for MapPoint - MP2K Magazine This thread Refback 03-10-2008 10:47 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
Adding own custom pane on the left of winwod hegdek MapPoint 2006/2009 Discussion 1 12-01-2006 08:20 AM
Adding custom symbols located on the internet dave17 MapPoint 2006/2009 Discussion 4 11-25-2006 12:36 PM
Adding custom field to a Pushpin marcocim MapPoint 2006/2009 Discussion 1 06-12-2005 04:13 PM
Adding custom pushpin symbol M.Vrolijk MapPoint 2006/2009 Discussion 2 09-20-2004 06:55 AM
Adding custom pushpins to the pushpin selection Anonymous MapPoint 2006/2009 Discussion 1 11-28-2003 03:28 PM


All times are GMT -5. The time now is 01:00 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

Ski Package Holidays
Search the latest ski package holidays in just a few clicks. The Holiday Hypermarket ski holiday search will show you what the top travel brands have to offer you.

Flights to Greece
Find cheap flights to Greece on Travel Counsellors. A personal Travel Counsellor can help you plan flights and find accommodation in Greece.

Cheap Flights to Cape Town
Here at dealchecker.co.uk we’ll shop around for cheap flights to Cape Town so you don’t have to. Find and Compare prices from over twenty UK travel agents with just one search.

Egypt Holidays
Visit one of the most spectacular sightseeing destinations in the world with The Holiday Place. Egypt holidays provide a fantastic break!

Turkey
Before booking a holiday to Turkey check out the ULookUBook travel guide. Find out about the rich culture in Turkey before you go there to help you to make the most of your holiday.

Travel Guides
As far as travel guides are concerned, your best move would be to check out our website at Travel.co.uk

Cheap Holidays in Gran Canaria
Would you like to visit the Canary Islands, but you're on a budget? Get information on cheap holidays in Gran Canaria at On The Beach.


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