Select to view content in your preferred language

Advice on linking to data from Flex Viewer to SQL Server?

1495
20
09-29-2010 05:39 AM
MelissaJohnson
Occasional Contributor II
I know using just Flex there is no way to link to SQL Server but I was hoping to get some dialog going from the experts out there on the best and easiest way to do this.
I have my Flex Viewer 2.1 and want to pass my parcel ID to SQL Server to return additional records. 

Questions (Opinions):
Which is the easiest to learn for beginners?
Which method returns data fastest and taxes the server the least?

I am looking to take a class to learn how to do this (I wish ESRI had a class that explained connecting databases when building web mapping apps).  I am not sure which service type I should use.   In Flex you can use Blaze, Cold Fusion, HTTP, LCDS, PHP, Web Service or XML to connect to data services.  Maybe there are others out there as well.

If anyone has experience with any of these good or bad some advice would be greatly appreciated.
Thanks in advance!
Melissa
Tags (2)
0 Kudos
20 Replies
RobertScheitlin__GISP
MVP Emeritus
Melissa,

     I am not sure about the other ways out there but I use ASP.Net Webservice to do that on my site. I can't really talk about the ease of creating this service as I have been a .Net Developer for many years, so it came naturally to me. I do  know there are many examples that you can Google of how to create a web service in dot net. My querying of my SQL Server 2005 is very responsive and the data is just returned as XML so Flex has not issue traversing it. You will want to keep your queried data to exactly what you need and try to limit the amount returned. I pass a Parcel ID Number to my web service and that will ensure I only get one record returned.
0 Kudos
MelissaJohnson
Occasional Contributor II
Thanks Robert!  I have Googled the asp.net webservices for tutorials and had problems with them.  I am using the Visual Studio express 10 and haven't been successful following the instructions in them without getting errors.  I will keep looking.
thanks again.
Melissa
0 Kudos
NadeemShaukat
New Contributor II
Melissa,

     I am not sure about the other ways out there but I use ASP.Net Webservice to do that on my site. I can't really talk about the ease of creating this service as I have been a .Net Developer for many years, so it came naturally to me. I do  know there are many examples that you can Google of how to create a web service in dot net. My querying of my SQL Server 2005 is very responsive and the data is just returned as XML so Flex has not issue traversing it. You will want to keep your queried data to exactly what you need and try to limit the amount returned. I pass a Parcel ID Number to my web service and that will ensure I only get one record returned.


Robert,

I am also in a situation where I have to pass user input and access data from SQL Server database to be presented in a data grid. Could you elaborate on the steps that you have taken in your project  to facilitate this.

Thanks

Nshaukat
0 Kudos
MelissaJohnson
Occasional Contributor II
I am taking an ASP.net class next week so I can learn more about coding a webservice to access my SQL server data.  I searched through the web and found some helpful links, but they just didn't quite take me where I need to be in the details of coding the webservice for my purposes.  Hopefully things will be clearer for me after the class!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nadeem,

   Not much more I can elaborate on the development of a .Net webservice is completely specific to your data and as I said there are many examples out there, but you will have to have a fairly decent .Net programming ability to get started. Once you have the web service returning your data as xml than parsing it in flex is pretty easy. I don't think I can dumb this down with a generic example.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Melissa,

   Good luck in the class. Let us know how it goes.
0 Kudos
CarmenDurham
Occasional Contributor II
Melissa,

About a year ago, we got a "Web handler/service" from ESRI called "GeoRSSSite" that we used to access data from a SQL table (Fire Truck locations updated every minute).

We were able to alter their code to connect to our data.  It was a bit of trial and error (as we had no clue what we were doing either), but we got it to work.  We really just edited the files directly in a text editor vs having to use VStudio.

I have used it over an over for various things - some for creating the XML to generate auto-complete lists. 

Maybe you can ask someone at ESRI if that is still available and if there are instructions???

Robert is the expert at this, but I can tell you that we got it to work without being an expert by any means. 😄

Carmen
0 Kudos
RickBaker
New Contributor
Nadeem,

   Not much more I can elaborate on the development of a .Net webservice is completely specific to your data and as I said there are many examples out there, but you will have to have a fairly decent .Net programming ability to get started. Once you have the web service returning your data as xml than parsing it in flex is pretty easy. I don't think I can dumb this down with a generic example.


I have a .net webservice where some of the functions return a single table (which works fine in FB4) but there are some that return an array of tables. This is causing me some grief in drilling in to the individual tables to get the data. Do you have any experience with this. Any suggestion is appreciated.
0 Kudos
EmilyLaMunyon
Occasional Contributor
Hello,
Can the Flex Viewer connect to the webservice of your choice, such as a ColdFusion webservice?

Thanks!
0 Kudos