[Mono-dev] System.DllNotFoundException: gda-2 in (wrapper managed-to-native) System.Data.OleDb.libgda:gda_init (string,string,int,string[])

Morten monouser at mikkelsens.net
Fri Jan 27 14:23:01 EST 2006


Hi.
Hoping to no offend anyone with a newbie-question.
I just installed mono and found some examples that I am trying to get up 
and running, but something very basic stops me.
I am using mono-1.1.13.2 on a Windows2000 machine.
What doesn't work is:

<pre>
using System;
using System.Data;
using System.Data.OleDb;

namespace HelloWorld {
   class Program {
     private static string dbConPrefix =
       "provider=Microsoft.JET.OLEDB.4.0; data source=C:\accessdb.mdb";

     static void Main(string[] args) {
       string sqlStmt = "SELECT * FROM aTable";
       OleDbDataAdapter da = new OleDbDataAdapter(sqlStmt, dbConPrefix);
       DataSet ds = new DataSet();
       da.Fill(ds, "SomeData");
     }
   }
}
</pre>

When I compile with just 'mcs HelloWorld.cs', I get:
HelloWorld.cs(2,7): error CS0234: The type or namespace name `Data' does 
not exist in the namespace `System'. Are you missing an a
ssembly reference?
HelloWorld.cs(2,1): error CS0246: The type or namespace name 
`System.Data' could not be found. Are you missing a using directive o
r an assembly reference?
     Try using -r:System.Data
HelloWorld.cs(3,7): error CS0234: The type or namespace name `Data' does 
not exist in the namespace `System'. Are you missing an a
ssembly reference?
HelloWorld.cs(3,1): error CS0246: The type or namespace name 
`System.Data.OleDb' could not be found. Are you missing a using direc
tive or an assembly reference?
Compilation failed: 4 error(s), 0 warnings

Then, I try: 'mcs -r:System.Data.dll HelloWorld.cs' and it compiles 
without problems.

But when I try running it with 'mono HelloWorld.exe' I get
Unhandled Exception: System.DllNotFoundException: gda-2
in (wrapper managed-to-native) System.Data.OleDb.libgda:gda_init 
(string,string,int,string[])
in <0x00031> System.Data.OleDb.OleDbConnection:.ctor ()
in <0x0000a> System.Data.OleDb.OleDbConnection:.ctor (System.String 
connectionString)
in (wrapper remoting-invoke-with-check) 
System.Data.OleDb.OleDbConnection:.ctor (string)
in <0x00028> System.Data.OleDb.OleDbDataAdapter:.ctor (System.String 
selectCommandText, System.String selectConnectionString)
in (wrapper remoting-invoke-with-check) 
System.Data.OleDb.OleDbDataAdapter:.ctor (string,string)
in <0x00034> HelloWorld.Program:Main (System.String[] args)

Here I am stuck - What do I do to get around that 
System.DllNotFoundException?
Google gives me nothing.

Thanks in advance,
/Morten



More information about the Mono-devel-list mailing list