Monday, August 27, 2007

Running Firebird Embeded Database in .NET 2

I wanted to create a small application to keep track of my daily expenses. Me and my friend (we are also room mates) think that we are expending too much because we are unstructured. So I thought to give it time this Sunday.

I decided to use embedded Firebird server for easy portability.

Go to Firebird site and it says that embedding Firebird is a breeze. Me to thought so. But it might be little cumbersome as many things have changed in Firebird version 2.
I downloaded Firebird embedded package. Copied fbembed.dll and Firebird.Data.FirebirdClient to my executable directory, but every time I tried to execute
FbConnection.CreateDatabase()
I got 'Unable to load DLL "fbembed"' error.

Googling for it yielded no results except advice for copying fbembed.dll and FirebirdClient assembly to the folder where executable is.

I copied everything from embedded package and it worked. But time and again it is mentioned that every thing from package is not needed. So now again I removed the embedded stuff and started things one-by-one.

  • First fbembed.dll and FirebirdClient assembly --> It did not work.


  • Then I added all the dlls (i*.dll) from embedded package with firebird.msg --> It did not work.<.li>
  • Then I added intl folder --> It worked!!!



No I coppied these files to bin folder and added the intl folder and the dlls to my .NET Project and set their build action as content and Copy to Output Directory as Copy Always.

It is working fine and I don't have to copy it to release or debug folders.

Happy Codding ;-)

5 comments:

Darius Damalakas said...

Nice!

thanks for inho,

I've tried to use embedded version, but i never managed to run it

Anonymous said...

You can find info on http://blog.vyvojar.cz/jirka/archive/2007/01/28/firebird-embedded-and-net.aspx . Quick&Dirty.

me said...

I was struggling with the same problem for days, and to me only the following files were needed on the EXE folder:

fbembed.dll
FirebirdSql.Data.FirebirdClient.dll
icudt30.dll
icuin30.dll
icuuc30.dll
msvcp71.dll

No need to include the INTL folder nor the other DLLs.

達Ming said...

If you see this Post on Official Site.I think you will ignore firebird...
http://www.firebirdsql.org/dotnetfirebird/blog/2005/11/how-to-use-embedded-firebird-in-aspnet.html

asp.net will lock firebird db

Unknown said...

Thanks for posting this. It comes as great help.