0

I develope a desktop application with firebird embeded database. I download FirebirdSql.Data.FirebirdClient.dll.I add this dll to reference. I add these file to output folder

aliases.conf
fbembed.dll
firebird.conf
firebird.msg
ib_util.dll
icudt30.dll
icuin30.dll
icuuc30.dll

And I use this connection string

 String connectionString="ServerType=0;User=SYSDBA;Password=masterkey;Dialect=3;Database=mydb.fdb"; 
 FbConnection con = new FbConnection(connectionString);
                try
                {
                    con.Open();

                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }

But i got this error and i search from google but i cannot find solution is there anyone help me? Note: I look at this but it didn't work.

http://stackoverflow.com/questions/4014097/how-to-connect-and-use-firebird-db-embedded-server-with-visual-c-sharp-2010?answertab=votes#tab-top

FirebirdSql.Data.FirebirdClient.FbException (0x80004005): Unable to complete network request to host "localhost". ---> Unable to complete network request to host "localhost".
    FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()
    FirebirdSql.Data.FirebirdClient.FbConnectionPool.Create()
    FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut()
    FirebirdSql.Data.FirebirdClient.FbConnection.Open()
mikel
  • 15
  • 2
  • 8
  • It looks like your application is ignoring the embedded part and performing a standard connection request trough the network. Are you sure `fbembed.dll` is beging loaded by your program? Some database access layers require `fbembed.dll` to be renamed to the former firebird client (`fbclient.dll`) in order to work, but I don't know the .NET client, so I'm not sure about this. – jachguate Mar 21 '13 at 00:41
  • thanks for response.I renamed the fbemded.dll to fbclient.dll another error occured. – mikel Mar 21 '13 at 06:36

1 Answers1

1

Connection string is wrong. ServerTypeshould be 1.

cincura.net
  • 4,130
  • 16
  • 40
  • I got this error System.BadImageFormatException: (HRESULT özel durum döndürdü: 0x8007000B) FB_965910463_Class.isc_attach_database(IntPtr[] statusVector, Int16 dbNameLength, Byte[] dbName, Int32& dbHandle, Int16 parmBufferLength, Byte[] parmBuffer) FB_965910463_Class.IFbClient.isc_attach_database(IntPtr[] statusVector, Int16 dbNameLength, Byte[] dbName, Int32& dbHandle, Int16 parmBufferLength, Byte[] parmBuffer) FirebirdSql.Data.Client.Native.FesDatabase.Attach(DatabaseParameterBuffer dpb, String dataSource, Int32 port, String database) – mikel Mar 21 '13 at 08:03
  • 3
    Your app is 64bit and you have 32bit `fbembed.dll` (or vice versa). – cincura.net Mar 21 '13 at 09:48
  • 1
    My app is 64bit and I download NETProvider-3.0.2.0-NET40.7z from http://www.firebirdsql.org/en/net-provider/ for provider and I download other files from http://sourceforge.net/projects/firebird/files/firebird-win64/2.5.2-Release/Firebird-2.5.2.26539-0_x64_embed.zip/download when I use these files I got error – mikel Mar 24 '13 at 06:50
  • System.DllNotFoundException: Unable to load DLL 'fbembed' FB_965910463_Class.isc_attach_database(IntPtr[] statusVector, Int16 dbNameLength, Byte[] dbName, Int32& dbHandle, Int16 parmBufferLength, Byte[] parmBuffer) FB_965910463_Class.IFbClient.isc_attach_database(IntPtr[] statusVector, Int16 dbNameLength, Byte[] dbName, Int32& dbHandle, Int16 parmBufferLength, Byte[] parmBuffer) FirebirdSql.Data.Client.Native.FesDatabase.Attach(DatabaseParameterBuffer dpb, String dataSource, Int32 port, String database) – mikel Mar 24 '13 at 06:56
  • FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect() FirebirdSql.Data.FirebirdClient.FbConnectionPool.Create() FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut() FirebirdSql.Data.FirebirdClient.FbConnection.Open() FirebirdApp.Form1.button1_Click(Object sender, EventArgs – mikel Mar 24 '13 at 06:56
  • You don't have fbemded.dll around. See: `System.DllNotFoundException: Unable to load DLL 'fbembed'`. – cincura.net Mar 24 '13 at 16:14