Firebird database in Embedded in C# with Entity Framework

538 Views Asked by At

Can Firebird database be used in embedded mode like SQLite? When working with Entity Framework in SQLite, if I write the database name in the connectionString (example.db), when I run it, a new database is opened in the bin folder. Can I use Firebird the same way?

Or is there a different way to use Firebird without installing its server.

1

There are 1 best solutions below

0
On

Yes, you can use Firebird Embedded with FirebirdSql.Data.FirebirdClient. In the connection string you must specify ServerType=1 (or ServerType = FbServerType.Embedded when configuring through code), and only specify the path to the database (no host name).

However, to be able to do this, you must include all the necessary binaries for Firebird Embedded in your project yourself (or make sure it is on the PATH when you run your application).

That is, when you deploy your application, the directory containing your application must contain fbclient.dll, plugins\engine13.dll (Firebird 4.0, engine12.dll for Firebird 3.0) and all required supporting files, or a directory containing those files must be on the PATH.

In its simplest form, you can obtain those files by downloading the Firebird 4.0 zipkit of the appropriate bitness from the Firebird 4.0 download page. You can optionally remove all the .exe and .bat files, security4.fdb and directories doc, examples, help, include, lib, misc, and system32, although this still leaves some files that are not strictly necessary.

You may also want to read Problem connecting to Firebird 3 embedded with C# in .NET.

In short, it is possible, but it is not as simple as a SQLite deployment.