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
perfect, it works fine in vs2008 too
perfect, it works fine in vs2008 too, only replacing in each line contain 8.0 to 9.0 in machine config file. thx
Error while Adding Data connection
HI...
Thanks for ur article.it was very helpfull,n it went very fine till Step 6.but aftr tat wen i tried to add a data connection i coudnt make it.
the error is as below
"An Unexpected error occurred in .Net data frame work provider for firebird.Please contact the provider vendor to resolve this problem"
Again i cross checkd evrthng.but same hapned.
please help me.
Thanks in Advance
RE: Error while Adding Data connection
Hi,
I'll try and see if I can help you break down the cause of your error. Keep in mind it has been a while since I've used this so I can't remember all the errors I first ran into and possible causes.
Lets start with what did work. When you get to step 7 and select 'add connection" does the dialog come up or does it give you the error right away? If not, then at what point did you get the error?
Are you using the same version of the Firebird DDEX Provider and/or Firebird Client that I used in the example or a new version? If it's a newer version, then which version of each?
What OS are you using and is it 32 bit or 64 bit?
Did you do the Packaged or PackageLess install?
The error you're getting would indicate that the Firebird driver is being picked up by Visual Studio but fails to find all library references correctly. This is almost guaranteed to mean that part of the setup is correct (enough for it to attempt to lookup the Firebird driver), but something is registered incorrectly so it fails to find all associated assemblies.
You can manually verify each registry key (in the registry, not in the file) that is imported from the FirebirdDDEXProvider32.reg or whatever .reg file you used. If you haven't done this, then it might be worth checking - it's a bit of pain to navigate through the registry to check each key and value but it might help.
Hi... Thanks for ur
Hi...
Thanks for ur reply....I wil explain each
1)when I select "Add connection" aftr some 2 secs the dialog comes up with the mentioned error bfore.
2)Am using the same version u used (I downloded from example which u gave)
3)am using windows server 2003 entrprise edition sp2 (32 bit)
4)Packaged install (But then only noticed i have not installed visual studio 2005 SDk,then i installed that tool)
I chkd registry too its correct.
but in that readme.txt in C:\Program Files\FirebirdClientDDEX the version is different with one in gac.txt
in gac.txt version is 2.0.1 and in readme.txt its 2.0.0
once again thanks for ur help......
hope u wil sove it...
rgrds
RE: Error while Adding Data connection
I just built a new Windows Server 2003 R2 Enterprise machine with Service Pack 2 and then performed the following installs/setups:
1) Installed Visual Studio 2005 Team Edition (Shouldn't make any difference which addition except for the Express edition which is different and I've never tested it).
2) Installed Visual Studio 2005 SDK (VsSDKFebruary2007.exe) downloaded from Microsoft Site.
3) Installed Firebird-1.5.5.4926-3-Win32.exe (installed the super server)
4) I then made a test database and made sure Firebird was working and I could connect to the database.
5) Then I followed all my own instructions carefully using the 32bit Packaged install (FirebirdDDEXProvider32.reg).
6) Made sure my Machine.config entries for the PublicKeyToken match:
The top entry in machine.config matches the FirebirdSql.VisualStudio.DataTools entry (bae6c78ccb0fcdb3)
The bottom entry matches the FirebirdSql.Data.FirebirdClient (3750abcc3150b00c)
7) Made sure to check all 5 assemblies in the tools section of Visual Studio including the FirebirdSql.VisualStudio.DataTools.dll that had to be manually added as per the instructions.
NOTE: I made sure to add the "InprocServer32"="C:\\WINDOWS\\system32\\mscoree.dll" with the full path. Although it's not suppose to be required, I've found it is more often that not.
I launched VS2005 and selected Add Connection. It first asked me to pick a data source driver. So I selected the Firebird option. Then I got the dialog shown in step 7 of my instructions. I added my connection information and connected to my test database.
Everything worked fine for me first attempt.
NOTE: My readme.txt also refers to 2.0.0. I think the readme just wasn't changed when they went from 2.0.0 to 2.0.1.
If nothing in my steps above helps you then I'm not sure what else to offer. It is possible something in my instructions makes perfect sense to me but maybe is misleading to other people.
Hope this helps.
I don't know why but the
I don't know why but the controls in VS 2008 just won't show. The FirebirdDDEXProvider32.reg file seems to be the PackageLess version as there is only one %Path% to replace. It's really getting on my nerves.
This is it - the only file for VS2008 (V9.0):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataSources\{2979569E-416D-4DD8-B06B-EBCB70DE7A4E}]
@="Firebird Data Source"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataSources\{2979569E-416D-4DD8-B06B-EBCB70DE7A4E}\SupportingProviders\{92421248-F044-483A-8237-74C7FBC62971}]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\{92421248-F044-483A-8237-74C7FBC62971}]
@=".NET Framework Data Provider for Firebird"
"DisplayName"="Provider_DisplayName, FirebirdSql.VisualStudio.DataTools.Properties.Resources"
"ShortDisplayName"="Provider_ShortDisplayName,FirebirdSql.VisualStudio.DataTools.Properties.Resources"
"Description"="Provider_Description, FirebirdSql.VisualStudio.DataTools.Properties.Resources"
"CodeBase"="%Path%\\FirebirdSql.VisualStudio.DataTools.dll"
"InvariantName"="FirebirdSql.Data.FirebirdClient"
"Technology"="{77AB9A9D-78B9-4ba7-91AC-873F5338F1D2}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\{92421248-F044-483A-8237-74C7FBC62971}\SupportedObjects]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\{92421248-F044-483A-8237-74C7FBC62971}\SupportedObjects\DataConnectionSupport]
@="FirebirdSql.VisualStudio.DataTools.FbDataConnectionSupport"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\{92421248-F044-483A-8237-74C7FBC62971}\SupportedObjects\DataConnectionProperties]
@="FirebirdSql.VisualStudio.DataTools.FbDataConnectionProperties"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\{92421248-F044-483A-8237-74C7FBC62971}\SupportedObjects\DataConnectionUIControl]
@="FirebirdSql.VisualStudio.DataTools.FbDataConnectionUIControl"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\{92421248-F044-483A-8237-74C7FBC62971}\SupportedObjects\DataSourceInformation]
@="FirebirdSql.VisualStudio.DataTools.FbDataSourceInformation"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\{92421248-F044-483A-8237-74C7FBC62971}\SupportedObjects\DataObjectSupport]
@="FirebirdSql.VisualStudio.DataTools.FbDataObjectSupport"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\{92421248-F044-483A-8237-74C7FBC62971}\SupportedObjects\DataViewSupport]
@="FirebirdSql.VisualStudio.DataTools.FbDataViewSupport"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Services\{AEF32AEC-2167-4438-81FF-AE6603341536}]
@="{8d9358ba-ccc9-4169-9fd6-a52b8aee2d50}"
"Name"="Firebird Provider Object Factory"
Firebird DDEX Provider and VS2008
I haven't actually tried to install the provider with VS2008. I haven't been working with Firebird for quite some time now.
I'll see if I can get a chance to take a look at it.
Can you give me a little more background on what your doing.
-Which version of Firebird are you running?
-Which version and where did you download the provider install your using?
-What works and specifically what doesn't?
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