Searching pushpin sets in C#

Anonymous
01-17-2005, 01:51 PM
I have read through many posts on this forum, and I can not figure out why this does not work. I have three pushpin sets, and I want to search one particular set for a certain pushpin. I have declared all the datasets and recordsets variables but I can not figure out how to select which pushpin set I want to look through.

MapPoint.Location loc;
MapPoint.DataSets DSets = axMappointControl1.ActiveMap.DataSets;
MapPoint.DataSet Dset = axMappointControl1.ActiveMap.DataSets(???)
MapPoint.Recordset RSet = Dset .QueryAllRecords();

That is the part of the code I am referring to, but I dont know what goes where the question marks are. I thought i could use .Item but it does not work. Im new to mappoint, so Im probably missing something obvious, but I cant figure it out. Any help would be appriciated.

harpanet
01-17-2005, 02:08 PM
I use the following syntax to access MapPoint collections:

object index = "dataset name";
DataSet ds = m_Map.DataSets.get_Item(ref index);

It's a bit odd, but it works.

Wilfried
01-17-2005, 02:09 PM
Hi,

This access the dataset by number (it starts at 1 instead of 0):
object o = 1;
MP.ActiveMap.DataSets.get_Item(ref o);This is by name:
object o = "My other pushpins";
MP.ActiveMap.DataSets.get_Item(ref o);

Anonymous
01-17-2005, 04:51 PM
I just wanted to thank you both for your help. Your suggestions worked great. I knew it had to be something simple that I wasn't seeing. You guys saved me hours and hours of trying to figure it out.

Thank again.

 
Web mp2kmag.com
mapforums.com