At 07:35 PM 24/04/2009, Sporti Giulio wrote: >Content-class: urn:content-classes:message >Content-Type: multipart/alternative; > boundary="----_=_NextPart_001_01C9C4C0.1270A28A" > >Hi, > >I'm using Firebird .Net Data Provider 2.1.0 for .Net 2.0 and I'm trying to get >a reliable connection to Firebird Server 2.1. > >My simple .Net program checks continuously if the connection to Firebid server >is OK using the FbConnection class. This works well and I can verify if my >.Net program is connected or not. In case my .Net program starts when Firebird >service is down this program doesn't recognize anymore if the Firebird Service >goes up. It seems that FbConnection doesn't try to open the connection towards >Firebird server. > >I need a procedure (written in c# or in pseudo-code) to check better if my >.Net program is connected to Firebird server.
Actually, you want to know whether your program is connected to *your database* on the server. Presumably, the FbConnection class has some kind of Boolean member similar to FbConnection.Connected that is set true when isc_attach_database succeeds and is set false when isc_detach_database succeeds. In between, you have external events that might cause a connection to be broken, which the client-side object cannot detect until it attempts an operation and receives a database or network exception. So - first test the "connected" value (whatever it is: I don't use this interface) and then, if true, call simple query like "select 1 from rdb$database" which will return the scalar result 1 if the client is connected and an exception otherwise. Handle the exception and you have it done. Helen ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider