GetDataTable returning 0 records

2865
2
12-04-2015 04:30 PM
LisaT
by
Occasional Contributor III

Hi,

I know not many people are using ArcGIS Mobile, but I am thinking that this functionality may be broken elsewhere in ArcObjects, so hopefully I get some feedback!

I just upgraded to 10.3 from 10 and my GetDataTable call is returning 0 rows.  GetFeatureCount returns the correct count of features.  This is driving me nuts mainly because I have a WPF application that calls GetDataTable on the SAME MobileCache and it is returning the correct amount of rows.  Because of this I think my code may be irrelevant, but I will post it anyway:

            MobileCache constMapCache = new MobileCache();

            constMapCache.StoragePath = @"\\" + Environment.MachineName + @"\MobileCache\MasterCache";

           

            bool isOpen = constMapCache.IsOpen;  //returns false

            constMapCache.Open();

            bool isOpen2 = constMapCache.IsOpen;  //returns true

            FeatureSource selLyr2 = constMapCache.FeatureSources["mylayer"];

            FeatureDataTable completeTbl2 = selLyr2.GetDataTable(new QueryFilter());  //this does not work when passing a specific filter, either

           int countRows = completeTbl2.Rows.Count;  //0

           int countFeats = selLyr2.GetFeatureCount();  //476

This is a MVC web application.  Did something change in 10.3 to require a permission in IIS or something?  The WPF app is actually a WPF browser app, so it has to go through IIS, also.  The settings in IIS are different for each app, though. 

What gives?  Is there another way to get the attributes?  Since I can get the featureCount, is there a way to get the features and loop through them?          

0 Kudos
2 Replies
FreddieGibson
Occasional Contributor III

Do you have the same problem if you write a desktop console application and use the above code to get the data table? I'm not entirely familiar with your workflow, but I'm wondering if your application is being affected by the deprecation of DCOM.

You can review the following document for more information to determine if this applies to your current workflow.

Deprecation Plan for ArcGIS 10.1 and ArcGIS 10.2

http://downloads2.esri.com/support/TechArticles/W28703_DEPRECATION_PLAN_FOR_ARCGIS_10_1_and_10_2__Up... 

I've listed the information it displays about DCOM below.

ArcGIS 10.1 for Service will no longer support local connections (DCOM connections). ArcGIS 10.1 for Server will be a web services (REST, SOAP, and OGC) server only. This will have an impact on the following:

  • Custom developed applications form business partners and users using fine-grained ArcObjects through DCOM will not be supported. Thanks to the recent enhancements in server object extensions, developers can now migrate custom business logic written at the web application (web ADF) level to custom ArcGIS for Server services. Development against fine-grained ArcObjects continues to be fully supported following the server object extension pattern for extending ArcGIS for Server services. Esri has been recommending this approach for some time already due to its simplicity and improved performance.
  • Visit the following discussion (blogs.esri.com/esri/arcgis/2011/04/24/considerations-for-arcgis-server-developers-a-look-towards-10-1/) for details on alternatives to non-pooled services and local (DCOM) connections.

LisaT
by
Occasional Contributor III

Thank you for your quick reply!  I DID upgrade the App from .NET 4.0 to 4.5.1, so I looked into that a bit after reading your post.  I have saved the info in this post because it lists some very useful info!  I found the issue, however: I switched to a datareader and started getting errors on ESRI.ArcGIS.Runtime.Geometry.  I did not have that added as a reference to the project.  As soon as I added it, the datatable started populating rows.  I guess the GetDataTable() method does not throw an error, but requires this reference!  Thank you very much for taking a stab at it and providing the depreciation info.

0 Kudos