Community of VE/MapPoint Users and Developers
This is a discussion on Create Territory Type Dataset from SQL? within the Development forums, part of the MapPoint 2006/2009 Discussion category; I sort of understand the DataSet.ImportData and DataSet.ImportTerritories methods. However, I have discovered (I think all) the very few examples ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Create Territory Type Dataset from SQL? However, I have discovered (I think all) the very few examples showing how create a 'data' DataSet programmatically from a SQL database. You iterate through the sql data and add a location to dataset by doing a Map.AddPushpin(location) call followed by a Pushpin.Moveto(dataset) call. This is from Mr. Thota's archaic book about programming MapPoint. However this example is enormously sketchy in its details as all MapPoint examples seem to be. However, the example of code from Mr. Thota's book is the only example i can find 'normal' coding using a database. Everything else is for coding MS Office Automation solutions. And this code example handles none of the important features of a DataSet that makes them interesting or valuable. The DataSet methods that import files, Worksheets or Access tables all allow you to define the columns and types of the data. Those features seem to be necessary for showing Data on maps and for analyzing data in a geo-oriented way inside a DataSet. That is, you cannot set those properties as you add data to a DataSet in code in a record-by-record manner. The biggest clue is the fact that the DataSet Properties are all READ ONLY. Therefore the important properties can only be set by the DataSet.ImportData and DataSet.ImportTerritories methods. So... Can anyone verify the following? 1. DataSets created by adding locations or pushpins can only be used to display pushpin maps? 2. Territory DataSets can only be created by importing physical Files, Worksheets and Access tables (things named in the DataSourceMoniker parameter)??? 3. I'm a dead duck if my future hangs on being able to manage Territories if my data is in a database and I don't want to read data from the database and then create a temporary CSV file to read in the data using the ImportTerritories method that can only accept a 'moniker'. Thanks, Kimball |
| |||
| Re: Create Territory Type Dataset from SQL?
Mr. Ohr, thanks for taking time to respond. My questions are about the methods for adding items to MapPoint.DataSet objects that are available in the MapPoint API. Looking at C. Thota's book, 'Programming Mappoint in C#', i see this: add data from an Excel Spreadsheet: MapPoint.DataSet dataset = map.DataSets.ImportData(filePath, fieldSpecifications, MapPoint.GeoCountry.geoCountryUnitedStates, MapPoint.GeoDelimiter.geoDelimiterDefault, MapPoint.GeoImportFlags.geoImportExcelSheet); add data from an Access database: MapPoint.DataSet dataset = map.DataSets.ImportData(filePath, missing, MapPoint.GeoCountry.geoCountryUnitedStates, MapPoint.GeoDelimiter.geoDelimiterDefault, MapPoint.GeoImportFlags.geoImportAccessTable); add data from SQL Server: MapPoint.DataSet dataset = map.DataSets.AddPushpinSet("NorthWind Orders"); Please notice that adding from SQL server can only create a dataset composed of pushpins. This means that the column data is not available. i think that information is necessary for selecting the Territories, such as the ZIP CODE layer in MapPoint. Am I correct in assuming that the MapPoint API can not be used with a SQL Database EXCEPT for creating datasets composed of PushPins? thanks, kimball |
![]() |
| Tags |
| create, dataset, datasets, deadduck, readonly, sql, territories, territory, type |
| ||||
| Posted By | For | Type | Date | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 11-11-2008 02:28 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Street Type | Johny | Wish List | 0 | 06-12-2007 03:11 PM |
| programmatically create a field for a MapPoint.Dataset? | citrix_99301 | MapPoint 2006/2009 Discussion | 1 | 03-18-2006 04:27 AM |
| Type of itinerary | ifc | MapPoint 2006/2009 Discussion | 0 | 04-28-2004 09:32 AM |
| Territory Dataset | jtere856 | MapPoint 2006/2009 Discussion | 0 | 11-26-2002 02:51 PM |
| Too Many Zip Codes to Create Territory | Anonymous | MapPoint 2006/2009 Discussion | 1 | 11-22-2002 02:20 PM |