ArcGIS for Server with SQL Server DB without the "special" esri geodatabase tables

4220
10
Jump to solution
08-25-2014 06:04 AM
Kawaal_Saleem
New Contributor II

Hi,

 

I've been looking for a solution to have my existing SQL Server database which contains some tables with columns of the data type geometry published as a feature service by ArcGIS for Server without converting the database to a "special" ESRI Geo database by adding other tables.

After long times of searching and trying and failing I've given up.

 

What I'm trying to do is to show and edit the data using an HTML5 arcgis web map application.

 

Is it possible to accomplish what I'm trying to do here?

If so, could you please provide me a step-by-step tutorial on how to set up and have it working?

 

Thanks in advance!

 

-Kawa

0 Kudos
1 Solution

Accepted Solutions
Reynaldde_Castro
Occasional Contributor

You can edit within the Javascript API but you would have to create a service to interact with the database.  You may want to look into using jQuery and Ajax to do this. You can do it all within the js api but you will have to extend it.  You can also use asp.net and js api to write the app. If you want to create a separate app for editing you can just create an asp.net app for editing purposes only and keep the two functions separate.

Here is a link I came across that shows how to insert data in sql server using jQuery and ASP.NET.  You could extend it to full editing. Insert Data Into SQL Server Using jQuery in ASP.Net

View solution in original post

10 Replies
Reynaldde_Castro
Occasional Contributor

Add your data as a query layer, ArcGIS Help 10.1 .  This will allow you to view your data directly from your database. You can create an msd file to pubclish on ArcGIS Server.  Make sure you are using a database connection that is visible for public consumption if you intend to allow the public to view your site.

Editing the data can be done using some application to edit your database.  That can be written using a windows app or a web app depending on your goal. 

Kawaal_Saleem
New Contributor II

Hi Reynald,

Thanks for your response!

So what you're saying is that it's only possible to use the arcgis js api to view/query the data, not for adding/editing?

Because I've already succeeded in having the data available for viewing/querying, the problem that I'm facing is that the feature service which I'm publishing is not giving me the options to enable "edit", "add" and "delete".

Thanks again.

-Kawa

0 Kudos
MathewSuran
New Contributor III

Kawa,

I am actually at the beginning stages of what you are attempting to do without editing.  Sorry I can not offer a solution but if you don't mind, do you have any resources that helped get you to where you are (I know that's a loaded question)?  As you know searching is a pain and can take some time to get a clear, if any, answer so any time you can save me will be much appreciated.

Thanks!

Mat

0 Kudos
Kawaal_Saleem
New Contributor II

Hi Mathew,

I don't remember where I found the resources that helped me, but I can help you come further anyway.

First thing is, I'm using ArcGIS for Server 10.2.2

  • Open ArcCatalog
  • Add the database connection while using database authentication, not operating system authentication
  • After this, open the ArcGIS Server Manager by going to http://localhost:6080/arcgis/manager/
  • Go to Site > Data Store
  • Register database by giving it a name and import the connection file you've created in ArcCatalog (C:\Users\YOURUSERNAME\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\Connection..... ..sde)

Now you've created the connection to the database in the server, the next this is to create the service.

  • Open ArcMap
  • On the right side of the window you'll see a tab called "catalog", open this
  • In the database connections find the connection you've created earlier an double click it.
  • Expand it and drag the table to the left side of the window to the Table of Content

Now you can publish this as a service

  • In the menu, go to File > Share As > Service
  • Select the first option (Publish a Service) and click next
  • Select the server, if it's not there yet, create a new connection, and click next
  • Select a folder, I've chosen to put it in the root folder. and click continue
  • (In the capabilities tab, I can only select Feature Access and only query this.)
  • All options I've leaved unchanged
  • Click analyze, it'll show you some information and errors if there are any. I've ignored the warnings.
  • Afterwards you can publish the service by clicking publish

That's it!

Best of luck.

-Kawa

MathewSuran
New Contributor III

Thanks for that info.  I actually made a lot of progress yesterday researching and successfully published a Geodata Service on our server.  In order to access the data to use in my js webmap, I found this article:  ArcGIS Help (10.2, 10.2.1, and 10.2.2)  Don't know if that helps you out at all.

0 Kudos
Reynaldde_Castro
Occasional Contributor

You can edit within the Javascript API but you would have to create a service to interact with the database.  You may want to look into using jQuery and Ajax to do this. You can do it all within the js api but you will have to extend it.  You can also use asp.net and js api to write the app. If you want to create a separate app for editing you can just create an asp.net app for editing purposes only and keep the two functions separate.

Here is a link I came across that shows how to insert data in sql server using jQuery and ASP.NET.  You could extend it to full editing. Insert Data Into SQL Server Using jQuery in ASP.Net

Kawaal_Saleem
New Contributor II

Well,, thank you!

So it's not going to be as easy as I thought

I'm going to try to do as you suggested.

Thank you for your help!

-Kawa

0 Kudos
Reynaldde_Castro
Occasional Contributor

We don't have the latest and greatest so we have to come up with other methods for editing data.  We are constantly about 2 versions behind from Esri's releases.

0 Kudos
AsrujitSengupta
Regular Contributor III

What version of ArcGIS are you using?

The capability to publish data as a feature service from a simple database was introduced at 10.2.

0 Kudos