Exceptions been thrown when reading a "Double" column

2842
4
01-13-2013 07:21 PM
by Anonymous User
Not applicable
Original User: mswedgar

Hi,

I've been suffered by a strange problem, I'm using FileGeoDatabase and reading a table, but the exception is thrown when getting the value, please see the sample from the attachment(sample code and FGDB dlls), can anybody help on this?

P.S. As the max size of rar is 2.0MB so I have to split the file into two parts.

Regards,
Edgar
0 Kudos
4 Replies
by Anonymous User
Not applicable
Original User: vangelo

There is no reason to include DLLs in a request for programming assistance, and every
reason not to.  Everyone who downloads the API gets all the FGDB DLLs, and only the
runtime DLLs are freely redistributable.

If you post your source code, or the smallest working version thereof which exhibits
the problem (preferably against the sample geodatabases that ship with the API),
you are far more likely to get assistance (I'm not going to download new software
to place unknown executables on my system).

You should also state which version of the API you are using (though you ought to
be using the most recent version, 1.3).  You should also specify what platform
and compiler you are using, and the target application wordsize (32-bit/64-bit).

- V
0 Kudos
MaoEdgar
New Contributor
Thanks for your reply, here is my code and attached is the data, I'm using the FGDB API version 1.2.0.136.

            Geodatabase geodatabase = Geodatabase.Open(@"../Database/FSD.gdb");
            Table gdbTable = geodatabase.OpenTable("Sewerlines");

            RowCollection rows = gdbTable.Search("ORIG_CONS_YR", "", RowInstance.Recycle);
            foreach (var item in rows)
            {
                item.GetDouble("ORIG_CONS_YR");
            }


Thanks,
Edgar
0 Kudos
by Anonymous User
Not applicable
Original User: vangelo

Looking at the table from ArcCatalog, there are only 33 non-NULL rows (of 1850),
so that makes me think it could be a null-handling issue -- you really should test
row.IsNull before getting the value.

I'm curious why you're using a DOUBLE to store values which are inherently SHORT
(I won't be around for the Y32K crisis, and neither will file geodatabases), or at least
integer of some kind (no rounding errors and range tests).

- V
0 Kudos
MaoEdgar
New Contributor
Thanks for your reply, that solves my problem.

Thanks,
Edgar
0 Kudos