How to use st_geometry functions inside query statements in ADO.net?

1250
1
08-28-2012 10:06 PM
srinivasreddy
New Contributor III
I have ArcSDE 10 and Oracle 11g installed on my Windows server 2003. And i am trying to query tables having st_geoemtry columns.and i have got the results when i am querying from SQL Developer, and queries are working fine. But when i am trying to access and filling into DataSet in c# using ADO.NET it is throwing exception like "Un supported data format" for st_geometry column.
and i want to write a webservice which having the capability to query ArcSDE (Oracle) by sql statements contains st_geometry operations.

Actually my main objective is querying oracle (ArcSDE) using asmx webservice(c#). If any body have any idea over this please share with me or at least some suggestions.

Thanks and Regards
SRI
0 Kudos
1 Reply
GarySinner
New Contributor III
We had a similar problem in our .NET application built using ArcGIS Engine.  We have a couple of features that normally use .NET to query the backend database.  When one of our clients updated their Oracle ArcSDE databases recently, they started to use ESRI's ST_GEOMETRY user defined type.  Queries against tables with an ST_GEOMETRY column started failing.  Lots of searching, and opened a support incident with ESRI.  The result of that incident were:

[INDENT]Thank you very much for your time discussing the issue with us. Here I would like to summarize our conversation over phone:

- We understand the importance of this issue, however unfortunately so far we dont' have any existing Esri libraries for querying oracle st_geometry in .NET IDE.
- Using ArcObjects, or st_AsText() could be a workaround depending on your workflow.
- As mentioned, we have customer posted the idea regarding this issue already, details please refer to the link below. You can always vote on the idea to promote it.

http://ideas.arcgis.com/ideaView?id=087E00000004LykIAE

[/INDENT]

If your searching has landed you on this thread, please go to the suggestion at the above link at vote for it!  Maybe ESRI will work on a solution...

In the meantime (could be a verrryyy long time), we were able to work around the problem in our system by changing one part of our system to use ArcObjects to do the query instead of .NET and Oracle.DataAccess.  In the other part of our system that has to use .NET and Oracle.DataAccess, we changed the "select *" query to first issue a query to the table to get the list of columns in the table, and then rebuild the query with an explicit list of columns, excluding the column with the ST_GEOMETRY data type.  Kind of a pain, but it worked.

Gary Sinner
0 Kudos