Barzo Barzo - 1 year ago 291
C# Question

Firebird .NET provider and embedded server 3

I'm trying to use .NET Firebird Provider to connect to the embedded FB 3.0.1 server.

As far as I know, (also written here (page 6)), there is no more fbclient.dll\fbembed.dll but a single client fbclient.dll used for remote and embedded access.

But when I call the FBConnection.Open() I get a System.DllNotFoundException:

Unable to load DLL 'fbembed':
Impossible to find the specified module (Exception from HRESULT: 0x8007007E).

Any ideas?

Answer Source

Looking in the Provider code the default Client Library is fbembed (maybe for compatibility):

internal const string DefaultValueClientLibrary = "fbembed";

Now, passing the new value to the ConnectionString do the trick:

  var connectionString = new FbConnectionStringBuilder
    Database = dbPath,
    ServerType = FbServerType.Embedded,
    UserID = "SYSDBA",
    Password = "masterkey",
    ClientLibrary = "fbclient.dll"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download