PDA

View Full Version : The Array of Fields - Mappoint 2010 - help!



xonji
09-23-2011, 03:55 AM
Dear Community,

I have a problem with defining my Array of Fields, it doesn't work how i want it to work :).

Every time i tryin to create this arrayOfFields it throws an Exception:


InnerException: "No matching method defined for these fields."

Here my C# Code:

String fileInput = @"c:\test.csv";


object[,] fieldSpecifications = null;
fieldSpecifications = new object[3, 2];
fieldSpecifications[0, 0] = "Firma";
fieldSpecifications[0, 1] = MapPoint.GeoFieldType.geoFieldName;
fieldSpecifications[1, 0] = "Postleitzahl";
fieldSpecifications[1, 1] = MapPoint.GeoFieldType.geoFieldPostal3;
fieldSpecifications[2, 0] = "Sales";
fieldSpecifications[2, 1] = MapPoint.GeoFieldType.geoFieldData;



MapPoint.DataSet dataSet = myMap.DataSets.ImportData(fileInput,
fieldSpecifications, MapPoint.GeoCountry.geoCountryGermany,
MapPoint.GeoDelimiter.geoDelimiterSemicolon,
MapPoint.GeoImportFlags.geoImportFirstRowIsHeading s);

my .csv file looks like that:


"Firma";"Postcode";"Salesamount"
"IEMENS AG";"63475";"15480"
"IEMENS AG";"63475";"15480"
"IEMENS AG";"63475";"16305"
"IEMENS AG";"77933";"100,02"

The aim is to Show the data on a datamap with the sales amount, in order of the postal code (German Postal).
But the Error is at the moment the big break in my project.

best regards
tv

--------------------------------------------------------------------------------
EDIT:
Ok the Problem is solved!
The "Postcode" string , and the "Salesamount" string was named false in the fieldSpecifications initializations.

-> they have to be equal! /closed