Select to view content in your preferred language

Invalid function argument in OpenTable method - API 1.3

5452
12
06-19-2014 12:33 AM
SunilTerkar
Emerging Contributor
Hello,

I am using API 1.3 with VS 2010, target framework .NET 4.0 and ArcGIS 10.0 with service pack 5.0. The file geo database is created in same ArcGIS version.

The File geodatabase uses British Coordinate System. It contains among few feature classes, polygon feature class "DMA". Below is my c# code causing me problem.

Geodatabase geodatbase = Geodatabase.open("D:\\Clean Water\\CW_Assets.gdb");
Table esriTable = geodatabase.OpenTable("DMA");

on the second line I am getting an error message "Invalid function argument". From other discussion thread on same topic I learned that API doesn't support customized coordinate system, but british coordinate system is not customized, it's standard coordinate system available in ArcGIS.

I did tried other method to check if I can access attribute data of "DMA".

RowCollection attributeQuery = geodatabase.ExecuteSQL("Select * from DMA"), the error message I got was "table not found".

I could see the existence of feature class "DMA" in ArcCatalog.

Can somebody advise what am I doing wrong?

Thanks in advance.

Sunil
0 Kudos
12 Replies
LanceShipman
Esri Regular Contributor
Try:

Table esriTable = geodatabase.OpenTable("\\DMA");
0 Kudos
SunilTerkar
Emerging Contributor
Hello,

I tried;

Table esriTable = geoDatabase.OpenTable("\\DMA");

But still getting "Invalid function arguments" error.

Any more advise.

Thanks,

Sunil
0 Kudos
LanceShipman
Esri Regular Contributor
I'm able to open a table named "DMA", so it's not a name issue.

Can you supply more information on the coordinate system? What is the name of the projection? The datum? Amy details would be helpful. As an experiment reproject the data or a subset into Robinson or similar.

Is the feature class involved in a network, topology or anything similar?
0 Kudos
SunilTerkar
Emerging Contributor
Hello,

Here are details of coordinate system used for "DMA" feature class and another feature classes in geodatabase.
Name of Coordinate System:- British National Grid
Projection:- Transverse_Mercator
Datum:- Ordinance Survey Great Brit.

It's pretty much standard system used in this part of world (UK). "DMA" feature class is not involve in any network but geodatabase contains Feature Dataset and some participating feature classes in geometric network. Following is a tree of feature classes as viewd in ArcCatalog

CW_Assets.gdb
FDS - Feature dataset
---CW_wDistributionMain - Feature class in Geometric network
---CW_wNetworkMeter - Feature class in Geometric network
---GN - Geometric network
---GN_Junctions - 
DMA - Feature class
GN_BUILDERR - Table

Let me know if you need more information.

Thanks,

Sunil
0 Kudos
LanceShipman
Esri Regular Contributor
I'm able to open a feature class named "DMA" which is in the UK national grid, so the coordinate system is unlikely to be the problem.

The fact that you can't open it and ExecureSQL can't find it, but ArcCatalog can see it. Was the file geodatabase upgraded from an earlier version (9.x). If so create a new file geodatabase and copy the data into it. Try to open the DMA feature class in the new file geodatabase.

Can you compile and run the C# samples? The display sample will not compile without additional software (see the readme). Run the Query sample.
0 Kudos
SunilTerkar
Emerging Contributor
Hello,

The filegeodatabase is created by ArcGIS 10.0 which is currently am using. I can compile c# sample code but cannot test it for lack of sample database. I did followed the steps given in sample code for writing my code. It seems kind of issue not able to figure out.

Thanks,

Sunil
0 Kudos
VinceAngelo
Esri Esteemed Contributor
I suspect your initial diagnosis (custom projection) is the problem.  The only way
we'll know for sure is if you copy the DMA table to a new file geodatabase, then
zip the new .gdb folder and post it here.

- V
0 Kudos
SunilTerkar
Emerging Contributor
Hello,

Please find "DMA" feature class in new file geodatabase as requested for testing.

Thanks,

Sunil
0 Kudos
LanceShipman
Esri Regular Contributor
ArcGIS see's your feature class as a "Custom" projection. The feature class I created as UK National Grid is not seen as "Custom". The projection information is the same. The xy domains are very different. I'll talk to the projection team and see what they have to say.
0 Kudos