If your having trouble getting your Firebird database working with Visual Studio then maybe this little tutorial will help you. I've tried to make it as detailed as possible since lack of information was my biggest problem getting it working for myself the first time. If there are any steps missing let me know and I'll be happy to add them in for future readers.
Edited: Since first putting this up I have had the chance to get it working for Windows XP x64, Windows Vista x64 and Windows XP x64 Packagless. In all cases the steps are mostly the same with only minor changes. I've added those changes into the steps below.
1. Installing the Software
- First I installed the FirebirdClient-2.0.1.exe (or the current newest version). This provides the client dlls used for connecting to Firebird through .net. It doesn't provide support for the Database Connections through the server explorer. However if you don't care about the popup interface dialogs for connections and queries this is really all you need.
- I installed this to the default directory C:\Program Files\FirebirdClient.
- Then I installed the DDEXProvider-2.0.1-RC2.exe. This provides the User Interface (UI) tool dlls needed for the server explorers and other interface dialogs to work with Firebird visually.
- I installed this to the default directory C:\Program Files\FirebirdClientDDEX. If your running x64 Windows then it would be C:\Program Files (x86)\FirebirdClientDDEX
2. The GAC
- In order to make use of both the provider dlls and the UI dlls they have to be installed in the GAC. This is a global location in the registry where visual studio looks for libraries. The firebird client dll actually gets installed in the GAC correctly for you but the DDEX Tools dll does not.
- In the FirebirdClient directory there is a tool gacutil.exe. You could manually navigate around in the registry to avoid using this tool but I think the tool makes it easier.
- Enter the following command at a dos prompt: gacutil /lr > gac.txt
- This will create a gac.txt file containing the entire contents of the GAC. Search for firebird and then delete the entries above and below this from the file and you will have only the entries we care about. The GAC output is alphabetical so all Firebird entries will be listed together.
Example:
FirebirdSql.Data.FirebirdClient, Version=2.0.1.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL SCHEME: <OPAQUE> ID: <FirebirdClient> DESCRIPTION : <Firebird .NET Data Provider 2.0.1 (.NET 2.0)>
FirebirdSql.VisualStudio.DataTools, Version=2.0.1.0, Culture=neutral, PublicKeyToken=bae6c78ccb0fcdb3, processorArchitecture=MSIL
FirebirdSql.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=3d06a02581b682f8, processorArchitecture=MSIL SCHEME: <OPAQUE> ID: <FirebirdClient> DESCRIPTION : <Firebird .NET Data Provider 2.0.1 (.NET 2.0)>
- When you first run this you will likely have only the FirebirdSql.Data.FirebirdClient and FirebirdSql.Web.Providers entries because the FirebirdSql.VisualStudio.DataTools is not installed by default.
- To install the FirebirdSql.VisualStudio.DataTools copy the gacutil.exe to your FirebirdClientDDEX directory if its not already there or in your path. Run the following from that directory: gacutil /i FirebirdSql.VisualStudio.DataTools.dll
- This will install the UI dlls to the GAC. Now run the gacutil /lr > gac.txt command again to get the new GAC listing. Now you should have both the FirebirdSql.Data.FirebirdClient and FirebirdSql.VisualStudio.DataTools entry in the GAC.
- The important information from this file is the following:
FirebirdSql.Data.FirebirdClient, Version=2.0.1.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL
FirebirdSql.VisualStudio.DataTools, Version=2.0.1.0, Culture=neutral, PublicKeyToken=bae6c78ccb0fcdb3, processorArchitecture=MSIL
3. Registry: FirebirdDDEXProvider32.reg
Now we need to add the registry entries for the UI and Providers. This is separate from the GAC.
- The install for the FirebirdClientDDEX added several files to the install directory (FirebirdDDEXProvider32.reg, FirebirdDDEXProviderPackageLess32.reg, FirebirdDDEXProvider64.reg, FirebirdDDEXProviderPackageLess64.reg). We will focus on the 32 bit versions since I'm not running a 64 bit OS. I have since tried this with Windows XP and Vista x64 using the FirebirdDDEXProvider64.reg and FirebirdDDEXProviderPackageLess64.reg and managed to get them working.
- The FirebirdDDEXProvider32.reg and FirebirdDDEXProvider64.reg are meant for people running Visual Studio 2005 full edition with the Visual Studio 2005 SDK Installed (The SDK comes separately and must be downloaded from Microsoft). The PackageLess version is for people who either don't have the SDK or have the Visual Studio Web Developer Express but I haven't seen it work with the Express edition yet.
- You need to modify the FirebirdDDEXProvider32.reg (or FirebirdDDEXProvider64.reg for x64 Windows) file before installing it. The majority of the file is fine but the following sections are important:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\
{8d9358ba-ccc9-4169-9fd6-a52b8aee2d50}]
@="Firebird Data Package"
"InprocServer32"="mscoree.dll"
"Class"="FirebirdSql.VisualStudio.DataTools.DataPackage"
"CodeBase"="%Path%\\FirebirdSql.VisualStudio.DataTools.dll"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\
{8d9358ba-ccc9-4169-9fd6-a52b8aee2d50}\SatelliteDll]
"DllName"="FirebirdSql.VisualStudio.DataToolsUI.dll"
"Path"="%Path%"
- The %Path% which appears twice must be replaced with your actual FirebirdClientDDEX directory like so:
"CodeBase"="C:\\Program Files\\FirebirdClientDDEX\\FirebirdSql.VisualStudio.DataTools.dll"
"Path"="C:\\Program Files\\FirebirdClientDDEX"
- NOTE that \\ is used not \ by itself. This is very important. If you use \ alone you won't get any errors but the key will not be generated correctly and end up missing from the registry entries.
- It may also be necessary to change "InprocServer32"="mscoree.dll" to "InprocServer32"="C:\\WINDOWS\\system32\\mscoree.dll". Your mscoree.dll should be in your C:\\WINDOWS\\system32\\mscoree.dlldirectory. While this change should not be necessary some people have reported problems without it and there is no harm making the change.
- Don't forget if your doing this for x64 Windows the path should be "C:\\Program Files (x86)\\FirebirdClientDDEX"
This process is the same for the PackageLess registry files except that the mscoree.dll is not included and there is only 1 place the path must be modified. The "CodeBase" section is the only one you have to modify for the packeless install.
4. Machine.config:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
This file contains alot of default configuration information used by Visual Studio 2005. We need to modify it to contain our provider information for Firebird. The base information is really straight forward to setup. The hard part is getting the PublicKeyToken correct for each entry.
If you have x64 Windows installed then there are actually 2 Machine.config files. One is in the FrameWork directory (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config) and the other is in the FrameWork64 directory (C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\CONFIG\machine.config). While I would have thought the FrameWork64 one would be important for the 64 bit install, its not. I ended up having to modify the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config to get mine working.
- Find the following section in your machine.config:
<configuration>
<configSections>
- Inside the add the following:
<section name="firebirdsql.data.firebirdclient"
type="System.Data.Common.DbProviderConfigurationHandler,
System.Data, Version=2.0.1.0, Culture=neutral,
PublicKeyToken=bae6c78ccb0fcdb3"/>
- Find the following section in your machine.config:
<configuration>
<system.data>
<DbProviderFactories>
- Inside the add the following:
<add name="FirebirdClient Data Provider"
invariant="FirebirdSql.Data.FirebirdClient"
description=".Net Framework Data Provider for Firebird"
type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory,
FirebirdSql.Data.FirebirdClient, Version=2.0.1.0, Culture=neutral,
PublicKeyToken=3750abcc3150b00c"/>
- Now go back to your entries you just added and make sure the Version, Culture and PublicKeyToken are correct based on your GAC entries. The above configuration is just an example from my GAC but yours should be similar.
- NOTE the entries in the <configSections> is related to the FirebirdSql.VisualStudio.DataTools entry in the GAC. This is in no way obvious and one of the hardest things to determine on your own. Thus the entry relates to the FirebirdSql.Data.FirebirdClient entry in the GAC. This allows you to choose the correct Version, Culture and most importantly the PublicKeyToken.
5. Visual Studio
Finally we are almost done, or at least done with all the annoying file and registry configuration steps.
- Launch Visual Studio or close it and launch it if you already had it running.
- In Visual Studio go the Tools-Choose Toolbox items menu and select this. The Choose Toolbox items dialog will popup. In the filter field at the bottom type in "firebird" to filter out all other entries.
- If they are not already checked then make sure you check "FbCommand", "FbCommandBuilder", "FbConnection" and "FbDataAdapter". These entries should already be there by now.
- If you have an entry for "FbDataConnectionUIControl" then also check that. If not then click browse and navigate to your FirebirdClientDDEX directory and select the FirebirdSql.VisualStudio.DataTools.dll. This will add an entry in for "FbDataConnectionUIControl". If everything else is setup correctly the directory should show as the "Global Assembly Cache', if not then close Visual Studio. Launch it again and go back to the same dialog and see if it does now. If not, a previous step was done incorrectly. If you get an error choosing the .dll file make sure you picked the right .dll. There are 2 of them in the directory and you can only add one of them.
- If you made it this far then in general your done. Assuming everything was done correctly it should work now.
- In the future it will be necessary to right click on your project in the solutions explorer and select "Add Reference" and choose the FirebirdSql.Data.FireBirdClient and possibly FirebirdSql.Web.Providers in order to have access client dlls from the code for a particular project.
6. Things to keep in mind
I've really only tried this with the full version of Visual Studio 2005 so I have no idea if it will work with other versions.
Make sure you download the Visual Studio 2005 SDK if you want to use the packaged install. It does not install with Visual Studio and it is not the same as the .net framework SDK. You can download it from Microsoft, just do a search for "Visual Studio 2005 SDK download". If you don't have this installed, the packaged install will not work, so you must use the packageless install.
7. Testing
To make sure its all working go to the server explorer and right click on data connections and select add connection. "Firebird Data Source" should now appear in the "Change Data Source" dialog. If you have been monkeying around in the connections before your add connection may default to another provider so you have to click the "Change button next to the Data Source field. Once you select "Firebird Data Source" you should get a dialog very specific to Firebird connections. If you don't get this dialog or don't get the "Firebird Data Source" option then at least one of the above steps was done incorrectly.

8. Installing Files
The latest install files can usually be found here on Source Forge. I've never actually used the DDEXProvider-2.0.1.exe available on Source Forge. I used the DDEXProvider-2.0.1-RC2.exe (attached below) which I can no longer find anywhere. It may be that the RC2 was dropped and the Source Forge one is the latest but I've never tried it.
Comments
typo error in the example
Hi,
In the 4. Machine.config section of article. there are two typo error;
<section name="firebirdsql.data.firebirdclient"type="System.Data.Common.DbProviderConfigurationHandler",
System.Data, Version=2.0.1.0, Culture=neutral,
PublicKeyToken=bae6c78ccb0fcdb3/>
the quotation mark " must be at the end of the public token instead of conf.handler.
Same will be for
<add name="FirebirdClient Data Provider"invariant="FirebirdSql.Data.FirebirdClient"
description=".Net Framework Data Provider for Firebird"
type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory",
FirebirdSql.Data.FirebirdClient, Version=2.0.1.0, Culture=neutral,
PublicKeyToken=3750abcc3150b00c/>
best regards...
type fix
Thanks :)
Little mistakes like that can cause others a lot of frustration.
Sorry for the delay in responding, apparently when we upgraded our site we accidently turned notifications off so I didn't know there was a comment.
Don't forget to use <code>, </code> tags around blocks of XML otherwise the tags in them cause problems in the article post.
Thanks again.
FirebirdDDEX
I am new to dot net and used your example to configure DDEX with Firebird 2.0. I managed to get 32 bit to work, kind-a, but could not get the 64 bit to work. I said it kind-a worked, this is why.
When I attempt to create a new data connection the Firebird Data Source shows up in the list of data sources as expected. When I select the add connection dialog it too shows up as expected but when I add a single character in the datasource, use the drop down to select a database, change from Client\Server to Embeded, etc. the dialog disapears. When I bring it back up previous selections are lost. I was wondering if you ran into this problem while you were figuring out how to configure the DDEX and what you did to correct the problem.
TIA dKoder
Dialog Disappearing
Hi,
Again sorry for the response delay we turned off notifications by mistake on our site. Since you also posted in the forums I'll answer this question there.
FirebirdClientDDEX with Visual Studio 2005 - Disappearing Dialog