Object reference error when using OleDbCommand object



Dear All,
We have created a WinForm application that uses OLEDB to connect to
Oracle DB. The Oracle client version is 8.1.6 and the Oracle DB version
is 10g...sometimes we randomly get errors like <Object reference error>
<Unable to retrieve error text for [0]>
The following are the stack strace information...
InnerException: Unable to retrieve error text for [0]
Stack Trace: at System.Data.OleDb.OleDbCommand.ProcessResults(Int32
hr)
at System.Data.OleDb.OleDbCommand.InitializeCommand(CommandBehavior
behavior, Boolean throwifnotsupported)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
behavior, Object& executeResult)
at
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at itbAS.Foundation.SQLHandle.ExecuteNonQuery(String sql)
Source: OraOLEDB
Extra Information:
Unable to retrieve error text for [0]

Or sometimes we get this error...
InnerException: Object reference not set to an instance of an object.
Stack Trace: at System.Data.Common.ICommandText.SetCommandText(Guid
rguidDialect, String pwszCommand)
at System.Data.OleDb.OleDbCommand.InitializeCommand(CommandBehavior
behavior, Boolean throwifnotsupported)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
behavior, Object& executeResult)
at
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at itbAS.Foundation.SQLHandle.ExecuteNonQuery(String sql)
Source: System.Data
Extra Information:
Object reference not set to an instance of an object.

It mostly fails at this query...
ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD hh24:mi:ss'

Is this the problem with the OLEDB driver? Or...

Please help...

Thanks & regards
Sunil

.



Relevant Pages

  • Re: Object reference error when using OleDbCommand object
    ... ¤ Dear All, ... The Oracle client version is 8.1.6 and the Oracle DB version ... ¤ behavior, String method) ... Is this the problem with the OLEDB driver? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: My list D2007 annoyances/todos I would like to see resolved in D2008
    ... OnCalcFields event of the TADODataSet seems to lose track when concatenating ... The problem only shows up when using Oracle (OLEDB ... D2007 will mess up my project files uses ...
    (borland.public.delphi.non-technical)
  • Re: OLEDBCommand vs. SQLCommand
    ... You do not *have* to use OleDb for Oracle. ... SQL compliant - assuming that SQL is a general specification, ... Both of the above are considered to be SQL statements and both do the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Can someone please tell me...(maybe Frans Bouma)
    ... Why no vendor independent way to get all tables, views, & stored ... The OleDb info is in the registry and the Oracle info is ... everything it could to have tons of clients shipped with Windows. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: connect to Oracle database
    ... Project VBA programming calls are better made in the project.developer ... to create a connection string, then use oledb calls to your Oracle db. ...
    (microsoft.public.project)