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

Daniel Morgan monodanmorg at yahoo.com
Fri Jan 27 16:30:42 EST 2006


Short Answer:
   
  System.Data.OleDb is unmaintained.   There is no support for Access nor Jet databases.
   
  Long Answer:
   
  No one maintains System.Data.OleDb anymore.
   
  System.Data.OleDb requires requires libgda from the gnome-db project at http://www.gnome-db.org/  however it only works on Linux. It does not work on Windows. Well, there have been attempts to port it to Win32, but I don't think they have been successful.
   
  Jet is the database egine used for Microsoft Access databases.   Mono does not support Access nor Jet.  Libgda has a provider for MDB Tools which allows you to read mdb files.  
   
  There are some patches to Mono for COM Interop.  So, you could try to get data from Jet via this.  But the COM Interop is not mature yet.  You have to search the mailing lists for the patches because they have not been committed to our subversion repository yet.
  
Morten <monouser at mikkelsens.net> wrote:
  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:



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");
     }
   }
}



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
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
  


		
---------------------------------
Do you Yahoo!?
 With a free 1 GB, there's more in store with Yahoo! Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060127/35994da7/attachment.html 


More information about the Mono-devel-list mailing list