[Mono-devel-list] Exception using ASP.NET (XSP) and OleDb cla ss

Gomez Aragoneses, Andres agomez at wke.es
Wed Sep 15 05:30:52 EDT 2004


Thanks for your comments.
 
I haven't found any file with the letters "gda" on my Mono directory, so I
believe the lib is not available (yet?). And if it existed there, why
wouldn't Mono installation set it by default on the config file? Is this
going to be implemented in the future? Should we submit a bug (RFE) report
about this?
 
I am going to test now the access with ODBC, as you recommend. I will tell
you when I have the results.
 
    Regards,
 
        Andrew
 

-----Mensaje original-----
De: Simon Bain [mailto:sibain at tendotzero.com]
Enviado el: martes, 14 de septiembre de 2004 18:15
Para: Gomez Aragoneses, Andres
CC: mono-devel-list at lists.ximian.com
Asunto: Re: [Mono-devel-list] Exception using ASP.NET (XSP) and OleDb class



Hi.

A partial help (sorry not the full).
The message is often due to a dll mapping not being found. If you look in
the mono config file 
Mono Install Directory/etc/mono/config  
you will see it there. What you will need to do is map the required dll to
the linux file. Eg for odbc connections you would normally have to add a
line in the config file like

<dllmap dll="odbc32" target="libodbc.so"/>

In this instance you may need (only may) something like
<dllmapp dll="gda-2" target="libgda-2.so.1"/>
You will need to get teh correct mapping for the windows file version.

I hope thsi helps, even if only a little.

Failing that you could try an ODBC connection, which you will need to have
unixODBC installed. I have used it with great success and speed across a
range of different databases. It may seem like a backward step from OleDb
but it does still work well, and there are a lot of drivers available.

In case you have not used it here is a connection example.
  public string callQuery(string strConnection, string strSQL)
  {
   string strReturn = " <results connectionstring=\"" + strConnection +
"\">\n";
   OdbcConnection dbcon = new OdbcConnection(strConnection);
   try
   {
    stringFunctions strClass = new stringFunctions();
               dbcon.Open();
               OdbcCommand dbcmd = new OdbcCommand(strSQL,dbcon);
               OdbcDataReader sqlreader = dbcmd.ExecuteReader();
    while (sqlreader.Read()){
            //Do something
     }
     //Carry on
Again I hope that this helps.

All the best
Simon
-- 
Simon Bain 
TENdotZERO 
---------- 
XML Open Conference Speaker:- Data Integration with XML and Mono 
http://www.xmlopen.org 
---------- 
XML 2004 Conference Speaker:- e-Voting 
http://www.xmlconference.org/xmlusa/ 

> Hello guys. 
> 
> I am developing an ASP.NET application and I have problems connecting to 
> the 
> database. No compilation errors but I catch this exception: 
> 
> System.DllNotFoundException: gda-2 in <0x00050> (wrapper 
> managed-to-native) 
> System.Data.OleDb.libgda:gda_init (string,string,int,string[]) in 
> <0x0003e> 
> System.Data.OleDb.OleDbConnection:.ctor () in <0x0000a> 
> System.Data.OleDb.OleDbConnection:.ctor (string) in <0x00053> (wrapper 
> remoting-invoke-with-check) System.Data.OleDb.OleDbConnection:.ctor 
> (string) 
> in <0x00065> ConexionDB:prueba () 
> 
> My block of code is: 
> 
> 
> public class ConexionDB { 
> 
> const string sCon = "DSN=cronos_geac_oracle;PASSWORD=xxxxx;UID=user;"; 
> 
> public string prueba () { 
> 
> OleDbConnection oCon; 
> 
> try { 
> oCon = new OleDbConnection(this.sCon); 
> } 
> catch (Exception e) { 
> return e+""; 
> } 
> 
> } 
> } 
> 
> The thing is that I have already found one person that has had my problem,

> but it seems no one replied his message (thread formed by only one 
> message): 
> 
> http://www.mail-archive.com/mono-list@lists.ximian.com/msg09588.html 
> 
> The unique difference, I think, is that I am on Windows XP and he is on 
> Linux. Version of Mono: 1.0.1. 
> 
> Anyone could comment anything about this? Thanks very much in advance. 
> 
> -- 
> Regards, 
> 
> Andrew 
> _______________________________________________ 
> Mono-devel-list mailing list 
> Mono-devel-list at lists.ximian.com 
> http://lists.ximian.com/mailman/listinfo/mono-devel-list 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040915/c50b5ba3/attachment.html 


More information about the Mono-devel-list mailing list