does anyone has an example of using SQL server in Flexviewer?
thanks
Nasif,
What do you mean by using SQL server in Flex, are you talking about an enterprise geodatabase held in SQL, being served through ArcGIS Server?
Please expand on your question
Regards
Anthony
hi Anthony
I am using Flexviewer. I have a mapserver for a layer. I want my users when they click on a point to be able to retrieve data from a SQL table that is in my SQL server database.
Thanks
.
When you say you have a layer from a mapserver is this an ArcGIS server? and have you configured your flex viewer to look at the REST endpoint, it will be something like this in your main config:
<layer label="Demographics" type="dynamic" visible="false" alpha="0.5" url="http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Median_Household_Income/MapServ...">
If so you can configure your viewer to make use of pop ups, see the help here:
If you are not using the REST endpoint and your layer is coming from a WMS there is currently no capability in the flex viewer to see the attributes (getFeatureInfo has not been implemented)
If I understand you correctly, you want to query SQL DB data based on a selection from a layer. I don't do much active Flex development, but I still maintain a large Flex app and build/update services for it.
I'd say you have a few options.
1. Related Records *
You can add the SQL tables to the original MXD and publish them with service as related records you can query.
2. WSDL
A WSDL is cheap and dirty, but works pretty good with Flex apps.
3. Create a REST API for SQL DB
You can write a vanailla REST API that access your SQL DB data. Lots of resources on the web and this forum on how to do this.
4. RemoteObjects
This one is a little trickier, but is a classic when building services that communicate with Flex apps. Not fully recommended these days, I don't think, but still effective.
* I would recommend using Related Records with a Flex app. No extra fuss getting things up and running. Unless you need a more complex query or do things like JOINS of tables, this is probably the easiest method.
Are you talking about flex connect to sql server DB? flex cannot directly connect to sql server DB, it need through some web server.
I follow the link below, it works:
http://www.codeproject.com/Articles/37649/Flex-Communication-with-ASP-NET-WebService
Good luck.
Thank you all for the help.. I got very good idea on what to do.
Regards,
Nasif Alshaier
Computer Services Manager
305-375-2775 Phone * 305-375-4940 Fax
"Delivering Excellence Every Day"