|     Blog    |     Wiki    |     Support

OracleFeatureLayer.Open() always results in NullReferenceException

(ThinkGeo.Oracle 12.1.4)

The following code always crashes:

new OracleFeatureLayer("User ID=me;Password=secret;Data Source=server/service",
                       "TAB", "FID").Open();
System.NullReferenceException: Object reference not set to an instance of an object.
   at ThinkGeo.Core.GdalFeatureSource.OpenCore()
   at ThinkGeo.Core.OracleFeatureSource.OpenCore()
   at ThinkGeo.Core.FeatureSource.Open()
   at ThinkGeo.Core.FeatureLayer.OpenCore()
   at ThinkGeo.Core.Layer.Open()
   at OracleTest.MainWindow.MapViewLoaded(Object sender, RoutedEventArgs e) in MainWindow.xaml.cs:line 42

As far as I can tell, the driver does not even try to create a network connection to the server.

The same error happens with or without correct information in the connection string, or with a string that does not even look like a connection string. I took the connection string from the MapSuite 10 examples; has the syntax changed in ThinkGeo.Core 12?

Hi Clemens,

Thanks for your question, in ThinkGeo 12, we rewrote the code of ThinkGeo.Oracle, move the driver from C# code to GDAL instead, thus the “Connection-string” changed as well, now it should follow the connection string definition of GDAL Oracle, shows at, When opening a database, its name should be specified in the form “OCI:userid/password@database_instance:table,table”.

Hope it helped.