1

I am using ODP.NET to get access to a geometry column in an Oracle database. My code (derived from Oracle's sample) often (but not always) crashes on the last line where the geometry column value is converted to the SdoGeometry type.

Any ideas?

OracleConnection oraConnection = new OracleConnection("User Id=scott;Password=tiger;Data Source=oracle");
oraConnection.Open();
OracleCommand oraCmd = new OracleCommand();
oraCmd.Connection = oraConnection;
oraCmd.CommandText = "select geometrie from gw_pro where pro_id=3357";
OracleDataReader oraReader = oraCmd.ExecuteReader();
oraReader.Read();
Geo.SdoGeometry geom = (Geo.SdoGeometry)oraReader.GetValue(0);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.