Custom Data Source Using Standard SQL Database

By Craig Unrein, Lead Software Developer, Laramie, WY

Orange ArrowDownload the script.

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

Advertisements

5 Responses to Custom Data Source Using Standard SQL Database

  1. VBAHole22 says:

    I would like to view your code but can’t get it to compile due to a version disagreement for ADF.Web.Datasource. I seem to 9.2.1.1332 but you reference an earlier version 1324.
    Have you heard of this issue and is there a way to resolve it?

  2. Craig Unrein says:

    Remove all the references in the project for the ESRI components, and reference them again. This should resolve the problem. Here is some additional information on how to use the script. It is also posted on the script description now.

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

  3. joe says:

    hi craig

    can you give me some sample which can demonstrate the advantage of this code pls?
    can you explain in few words what bring you to develope that code ?

    10x
    joe

  4. Craig Unrein says:

    In environments where geographic data is updated frequently and is stored in a system other then ArcGIS this is very useful. I use this code to display and access information in databases that are maintained by other departments or organizations. It eliminates the need to import the information into the ArcMap project.

    I developed this code to reduce the amount of work required to maintain the map services.

  5. joe says:

    10x craig

    thats exactly what im looking for

%d bloggers like this: