I found this code in VB.NET. It should do the trick.
Code:
Dim a As MapPoint.Shape
Dim objDataSet As MapPoint.DataSet
Dim objRecordset As MapPoint.Recordset
ListBoxValdaKunder.Items.Clear()
If Karta.ActiveMap.Shapes.Count > 0 Then
objDataSet = Karta.ActiveMap.DataSets("sbg031_2003")
Cursor.Current = Cursors.WaitCursor
a = Karta.ActiveMap.Shapes(Karta.ActiveMap.Shapes.Count)
objRecordset = objDataSet.QueryShape(a)
If objRecordset.EOF = False Then
Do Until objRecordset.EOF
ListBoxValdaKunder.Items.Add(objRecordset.Pushpin.Name)
objRecordset.MoveNext()
Loop
End If
End If
I, however, can't figure out which dataset I should use when I translate this line into C#:
Code:
objDataSet = Karta.ActiveMap.DataSets("sbg031_2003")
Is there a way to find out which datasets I can choose from?