Customer Service | Training | Contact Us
You are here: Home > Downloads > ArcScripts > Search Results > Script Details Login | Feedback | Help

Custom Data Source Using Standard SQL Database



contact author | download help | add bookmark | view bookmarks
Author Craig Unrein
File Name DataSource.zip
Language C#
Last Modified Oct 1 2007
Status of work Public Domain
Software ArcGIS Server
File Size 12.29 kb
Downloads 1031

ArcScripts is intended for the free exchange of scripts and tools related to ESRI software products. Please alert the moderator if this script is a demo, trial-version, or an advertisement for a retail product.


Summary
This is an example of how to create a simple custom data source that access a SQL 2005 database table w/ geographic point data and plot it on a map. It also implements the query interface so that Identify and Query work as well.

Here is a bit more detail:
This data source is for a Web Map Project.

Implementation Details - What will need to be changed:
First you will need to fix the SQL in the code to match your database information. Next the connection string is as follows:
XField=[Name of X Coord in DB Table];YField=[Name of Y Coord in DB Table];Layer Name=[Prefix for Layer Name];Data Source=[Server Name/IP];Initial Catalog=[Database Name];User Id=[Database User ID];Password=[Database User Password];
This is part of the MapResourceItem Node in MapResource Control.

Note the config file needs to be placed in the "[ArcGIS Install Dir]\DotNet" or it will not work.

This script is not setup to use map tips, please refer to the documentation to add these features. This is a good place to start http://edndoc.esri.com/arcobjects/9.2/NET_Server_Doc/developer/ADF/control_maptips.htm