MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Create Territory Type Dataset from SQL?

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 ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 11-08-2008
Junior Member
White Belt
 
Join Date: Feb 2008
Posts: 3
Create Territory Type Dataset from SQL?

I sort of understand the DataSet.ImportData and DataSet.ImportTerritories methods.

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
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 11-11-2008
Auge_Ohr's Avatar
Member
Green Belt
 
Join Date: Sep 2008
Location: Hamburg, Germany
Posts: 60
Re: Create Territory Type Dataset from SQL?

hi,

while there is no Answer, it might be nobody understand you Question ?

i´m still a Newbie but i try to Answer

Quote:
Originally Posted by kimballjohnson View Post
1. DataSets created by adding locations or pushpins can only be used to display pushpin maps?
what else shoud a PushPin do ?
you can get PushPin:Location(), use FindNearby() or make a Waypoint from
it but it is still a PushPin.

Quote:
Originally Posted by kimballjohnson View Post
2. Territory DataSets can only be created by importing physical Files, Worksheets and Access tables (things named in the DataSourceMoniker parameter)???
i´m not shure what your Dataset "countain" ? what you want "to do" with
it in Mappoint ?

Quote:
Originally Posted by kimballjohnson View Post
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'.
the activeX Way "is" the Way to do it, but you must not "import" hole Data
again ... only on a "empty" Map.

so "my Way" 1st to create a Map with all PushPin from my Customer where
i use Customer-ID as "Name" for PushPin. If i need to "update" a PushPin
i use activeX Methode FindPushPin(Customer-ID) to find is PushPin to
"update" Data.

hope i have understand you Question.
greetings by OHR
Jimmy
__________________
greetings by OHR
Jimmy
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 11-20-2008
Junior Member
White Belt
 
Join Date: Feb 2008
Posts: 3
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


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

Tags
create, dataset, datasets, deadduck, readonly, sql, territories, territory, type


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/create-territory-type-dataset-sql-9078.html

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

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
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


All times are GMT -5. The time now is 01:16 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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 52 53 54 55