[Mono-list] Using ODBC on Solaris for Oracle
Amc Gmail
amc1999 at gmail.com
Fri Oct 19 14:44:49 EDT 2007
It may come from SQLColAttribute() call inside of
OdbcDataReader.GetColumnAttributeStr()
In 1.2.4 incorrect size of buffer passed to SQLColAttribute() here. It
is fixed in Mono 1.2.5 which you may want to try.
all above is just pure guess, sorry if it isn't true. i have no
solaris+easysoft+oracle to test.
You may also consider of using System.Data.Oracle instead of ODBC.
good luck :)
On 10/16/07, Colin J. Paterson <colin.paterson at memex.com> wrote:
> I am currently trying to write an application that will use Mono on Solaris
> 10 as a server side tool to talk to a remote Oracle database. I have Mono
> 1.2.4 and have installed the instant client from Oracle and the EasySoft
> ODBC driver and verified that these work. I can run sql in sqlplus and
> everything connects fine and returns what I would expect. I can also run
> isql from EasySoft and this works fine. However when I run the following
> code
>
>
>
> _odbcConnection = new OdbcConnection("DSN=ORACLE");
> _odbcConnection.Open();
>
> OdbcCommand command = new OdbcCommand("SELECT * FROM EMPLOYEES",
> _odbcConnection);
> OdbcDataReader reader = command.ExecuteReader();
>
> Console.WriteLine("Reader Executed");
>
>
>
> It throws a System.Exception at the ExecuteReader() line and gives back the
> following message and call stack
>
> Exception ArgRange_Array
> Parameter name: count
> at System.Text.Latin1Encoding.GetString (System.Byte[] bytes, Int32 index,
> Int32 count) [0x00000]
> at System.Data.Odbc.OdbcDataReader.GetColumnAttributeStr (Int32 column,
> FieldIdentifier fieldId) [0x00000]
> at System.Data.Odbc.OdbcDataReader.GetSchemaTable () [0x00000]
> at System.Data.Odbc.OdbcDataReader..ctor (System.Data.Odbc.OdbcCommand
> command, CommandBehavior behavior) [0x00000]
> at System.Data.Odbc.OdbcDataReader..ctor (System.Data.Odbc.OdbcCommand
> command, CommandBehavior behavior, Int32 recordAffected) [0x00000]
> at (wrapper remoting-invoke-with-check)
> System.Data.Odbc.OdbcDataReader:.ctor
> (System.Data.Odbc.OdbcCommand,System.Data.CommandBehavior,int)
> at System.Data.Odbc.OdbcCommand.ExecuteReader (CommandBehavior behavior)
> [0x00000]
> at System.Data.Odbc.OdbcCommand.ExecuteReader () [0x00000]
> at (wrapper remoting-invoke-with-check)
> System.Data.Odbc.OdbcCommand:ExecuteReader ()
> at Memex.BatchImporter.DatabaseTester.Execute () [0x00000]
>
>
> Any help would be much appreciated on this, I can't see much wrong with what
> I am doing???
>
> Thanks in advance.
>
> Colin
>
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
More information about the Mono-list
mailing list