[Mono-devel-list] Re: Mono System.Data.OleDb || connection string

Met @ Uber met at uberstats.com
Mon Nov 3 20:24:25 EST 2003


On Mon, 2003-11-03 at 17:49, Rodrigo Moya wrote:
> On Mon, 2003-11-03 at 21:11, Met @ Uber wrote:
> > On Mon, 2003-11-03 at 11:23, Rodrigo Moya wrote:
> > > On Mon, 2003-11-03 at 16:26, Met @ Uber wrote:
> > > > My head hurts, so I'm not sure if I'm following you...
> > > > 
> > > > I need to use OleDb (System.Data.OleDb) because sadly that's all that
> > > > OJB.NET
> > > >
> > > OJB? What is that?
> > > 
> > > >  supports ATM.  So in order to do this I need to use Gda# too? 
> > > > Or does the provided OleDb replace the direct use of Gda#?  I'm a little
> > > > lost, would you mind clarifying a bit?
> > > > 
> > > you can use either OleDb or GDA# or any of the other options Daniel
> > > mentioned in his mail. One or the other, not at the same time.
> > > 
> > > OleDb uses libgda as an implementation detail, which causes a bit of
> > > confusion, since you need to setup libgda before using it on OleDb.
> > > Also, we don't support yet OleDb connection strings :-( which means you
> > > need to use libgda nomenclature to connect to the database.
> > > 
> > > GDA#, on the other hand, is a C# binding for the libgda library, so if
> > > you use it, you will be using directly libgda and its nomenclature.
> > > 
> > > If you still want to use OleDb, that's fine also, use whatever is better
> > > for you. But if you are going to use it, please fix the connection
> > > string support I mentioned above :-) It seems an easy task (which I'm
> > > sorry for not having done before :-( and will allow users to use the
> > > same code in windows and in linux.
> > > 
> > > cheers
> > > 
> > 
> > Would you happen to have a good resource for all the available string
> > options for ADO.NET and/or GDA?
> >
> for GDA, run gnome-database-properties, which will show you the list of
> all parameters for every provider.
> 
> For ADO.NET, I've got some of them in a book, but I'm sure you'll find
> docs online.
> 
> >   From the commented code it just looks
> > like your converting ADO parameters to Gda parameters which makes
> > sense. 
> >
> yes, I think it's the best thing to do, and straight forward.
> 
> >  Does the order of parameters matter for the *cnc_string that
> > gets passed into gda_client_open_connection_from_string() ?  
> > 
> no, no matter what the order is.
> 
> > Except for specific parameters that I don't know about, it's done.
> > 
> oh, cool!! Send the patch to mono-hackers-list at ximian, please.
> 
> And thanks a lot!
> 

Well I've gotten the connection up and running no problem.  But now I'm
hitting some errors in regards to type conversion.  Not sure why, but a
varchar from PostgreSQL returns GDA_VALUE_TYPE_UNKNOWN.  So basically if
you do reader.GetString(0) and that column is a string, it will throw a
type error.  But if you do reader.GetValue(0) it catches the unknown and
gda_value_stringify()'s it.  Do you have any opinion on how I go about
fixing this?  Also, is there anything in your mind needed in the
reader.Dispose() method except for closing stuff down as you would in
libgda?  Cause so far that's all I've done to get it to work.

Let me know.

~ Matthew




More information about the Mono-devel-list mailing list