FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
152 stars 63 forks source link

FirebirdDDEX v2.0.1.0 broken after installing FirebirdClient 2.1.0.0 RC1 [DNET98] #110

Closed firebird-automations closed 17 years ago

firebird-automations commented 17 years ago

Submitted by: Mike Bluett (mbluett)

Assigned to: @carlosga

After installing FirebirdClient-2.1.0-RC1.exe, and then subsequently dropping a FbConnection object onto a form, the ellipses that were present at the end of the ConnectionString property are no longer present.

I then added the connection string manually and then tried dropping a fbDataAdapter onto the form. The fbDataAdapter also is broken in that with the previous version of the FirebirdClient, there was a small right-pointing arrow on the top of the fbDataAdapter instance in the tray that is no longer present. This prevents any further "designer" capability (i.e., creating the FbCommand strings and setting up all the database constraints, etc.).

After encountering this problem, I de-installed the FirebidClient and the FirebirdDDEX, then made sure all registry entries were removed. Then I re-installed both of them and I still see the same problem.

firebird-automations commented 17 years ago

Commented by: @cincuranet

From your description I'm not sure, you're using DDEX. DDEX is abstract layer for creating DB objects in internal. But you're adding it manually, like in .NET 1.1 (which is still supported).

firebird-automations commented 17 years ago

Commented by: Mike Bluett (mbluett)

Yes I am using DDEX. The DDEX version is 2.0.1 (the latest one that is available). I am using the following installation file: FirebirdDEXProvider-2.0.2.exe Why it is called "2.0.2" when the DLL files are 2.0.1 I haven't a clue, but it is a little confusing.

The DDEX install program doesn't do much other than to extract the files. There is a Readme.txt file included which says you manually have to add 2 entries to the machine.config file and then you have to modify the .reg file to include the appropriate path where the DDEX files are located and then you have to run the .reg file to install the registry items and then you have to open MS VS 2005 and install the Firebird tools into your Toolbox.

Really this should all be automated.

firebird-automations commented 17 years ago

Commented by: @carlosga

You should update the assembly version and public token in the machine.config file

firebird-automations commented 17 years ago

Commented by: Mike Bluett (mbluett)

As mentioned in my original post, I did set the version and public key token in the machine.config file.

The 2 entries are as follows:

<configuration> <configSections> <section name="firebirdsql.data.firebirdclient" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c" />

<DbProviderFactories\>
  <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\.1\.0\.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c" /\>

The Readme.txt file says to set the %Version% and the %PublicKeyToken% to match that of the installed Firebird Data Provider. Since the only PublicKeyToken available is the one for the FirebirdClient, I assume this is the one I am supposed to use. That is why they are both set to 3750abcc3150b00c. This is the key that is set in the registry for the FirebirdClient.

Because I used the key for the FirebirdClient I assumed I should use the version of the FirebirdClient as well. That is why both are set to 2.1.0.0 (even though the DDEX is version 2.0.1.0).

Is this configuration correct?

firebird-automations commented 17 years ago

Commented by: @carlosga

This

> <section name="firebirdsql.data.firebirdclient" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.1.0.0, >Culture=neutral, PublicKeyToken=3750abcc3150b00c" />

Should be:

 <section name="firebirdsql\.data\.firebirdclient" 

type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

firebird-automations commented 17 years ago

Commented by: Mike Bluett (mbluett)

Why is the PublicKeyToken you have provided the correct one?

The key you have provided does not match the key that is associated with the FirebirdClient in the registry and that was established during the installation of the FirebirdClient. I find this very strange. Why are they not the same?

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\References\FirebirdSql.Data.FirebirdClient, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\References\FirebirdSql.Data.FirebirdClient, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL\{2EC93463-B0C3-45E1-8364-327E96AEA856}] "FirebirdClient"="Firebird .NET Data Provider 2.1.0 Release Candidate 1 (.NET 2.0)"

I changed the machine.config as you suggested and still the ellipses are missing from the ConnectionString property. As well, the fbDataAdapter cannot be configured with the Designer as I had mentioned in my original bug report.

Is there something else that I need to do after updating the machine.config file?

firebird-automations commented 17 years ago

Commented by: @carlosga

Because that lines references the System.Data assembly and not the FirebirdClient one.

firebird-automations commented 17 years ago

Commented by: Mike Bluett (mbluett)

Thanks for your previous response. However, you did not comment on even though I have made your requested change to the machine.config file that I still have the same problem.

Previous to installing the latest FirebirdClient, the Designer problems were not present and now they are. This certainly sounds like a bug to me.

Comments?

firebird-automations commented 17 years ago

Commented by: @carlosga

Are you using the Express edition of Visual Studio ??

DDEX is not available ( directly ) in Express Editions ( they have no support for third party DDEX providers ( unless you modify registry entries of one of the local providers instaled by the Express editions to match the firebird ddex provider configuration.

firebird-automations commented 17 years ago

Commented by: Mike Bluett (mbluett)

What registry entries would I have to modify and what modifications would be required?

firebird-automations commented 17 years ago

Commented by: @carlosga

Search in the devel list for a message of Robert Simpson explaining that, but be aware that that could be against the Microsoft license for express editions of Visual Studio.

firebird-automations commented 17 years ago

Commented by: @carlosga

Not a bug

firebird-automations commented 17 years ago
Modified by: @carlosga status: Open \[ 1 \] =\> Closed \[ 6 \] resolution: Won't Fix \[ 2 \]
firebird-automations commented 17 years ago

Commented by: Mike Bluett (mbluett)

If this is not a bug then why does it work properly with the FirebirdClient 2.0.1 and not with the FirebirdClient 2.1.0 RC1?

firebird-automations commented 17 years ago

Commented by: @carlosga

It was working on Express Edition ?? ( i doubt it ... as i have told Express Editions hasn't support for third party ddex providers )

firebird-automations commented 17 years ago

Commented by: Mike Bluett (mbluett)

It partially works with the Express Edition. The Designer part works as long as you use the FirebirdClient v2.0.1. Part of the Designer functionality is missing if you use FirebirdClient 2.1.0 RC1.

Even when using the FirebirdClient v2.0.1 there are problems, some of which can be corrected manually by editing the auto-generated source.

One is that the following code will cause VS EXpress to die:

        this\.fbCommand2\.Parameters\.AddRange\(new FirebirdSql\.Data\.FirebirdClient\.FbParameter\[\] \{
        new FirebirdSql\.Data\.FirebirdClient\.FbParameter\("@p1", FirebirdSql\.Data\.FirebirdClient\.FbDbType\.Integer, 4, System\.Data\.ParameterDirection\.Input, false, \(\(byte\)\(0\)\), \(\(byte\)\(0\)\), "ID", System\.Data\.DataRowVersion\.Current, \(\(object\)\(resources\.GetObject\("fbCommand2\.Parameters"\)\)\)\),
        new FirebirdSql\.Data\.FirebirdClient\.FbParameter\("@p2", FirebirdSql\.Data\.FirebirdClient\.FbDbType\.VarChar, 60, System\.Data\.ParameterDirection\.Input, false, \(\(byte\)\(0\)\), \(\(byte\)\(0\)\), "TITLE", System\.Data\.DataRowVersion\.Current, \(\(object\)\(resources\.GetObject\("fbCommand2\.Parameters1"\)\)\)\),

etc.

If you replace the code above with individual entries (rather than using AddRange) as follows, it no longer carshes VS Express.

     this\.fbCommand2\.Parameters\.Add\(new FirebirdSql\.Data\.FirebirdClient\.FbParameter\("@p1", FirebirdSql\.Data\.FirebirdClient\.FbDbType\.Integer, 4, System\.Data\.ParameterDirection\.Input, false, \(\(byte\)\(0\)\), \(\(byte\)\(0\)\), "ID", System\.Data\.DataRowVersion\.Current, \(\(object\)\(resources\.GetObject\("fbCommand2\.Parameters"\)\)\)\);

However, there is another error that occurs: Object reference not set to an instance of an object

You can get rid of this error to by replacing any "new string[]" parameters to do with the UniqueConstraint and ForeignKeyConstraint methods with an actual DataColumn object.

For example:

   this\.GENRE\.Constraints\.AddRange\(new System\.Data\.Constraint\[\] \{
        new System\.Data\.UniqueConstraint\("Constraint1", new string\[\] \{
                    "GENRE\_ID"\}, true\)\}\);

changes to:

 this\.GENRE\.Constraints\.Add\(new System\.Data\.UniqueConstraint\("Constraint1", GENRE\_ID, true\)\}\);

And of course you have to define an actual DataColumn called GENRE_ID and then add that to the appropriate table.

After doing all of this, I still ended up with one error I had great difficulties getting around: DataColumn must be added to a table. This error would occur even though I had the DataColumn added to a table.

To get around this error I removed quite a lot of the code from the auto-generated section and placed it elsewhere and did manage to get things working. However, in doing this I lost the ability to use the Designer to graphically populate combo boxes and fields: It all has to be done with manual coding.

So, in actuality, even v2.0.1 doesn't work. But the problems encountered look to me as though the Firebird stuff should be doing something behind the scenes to link the string column names with actual DataColumn objects (i.e., maybe in an XML file). Maybe this is the part that fails when using VS Express, but does work in VS.

I wish I knew how this linking took place, then I could fix it myself.

firebird-automations commented 17 years ago

Commented by: @carlosga

I think you mean the FbConnection, FbCommand and FbDataAdapter components right ??

That components are no longer available since v2.1, and they are not part of DDEX funcionality ( they are part of the old design time support )

firebird-automations commented 17 years ago

Commented by: Mike Bluett (mbluett)

Yes I do mean the FbConnection, etc components.

That is unfortunate that these components are not part of v2.1. In actaullity they appear to be a part of DDEX as they came from the file I downloaded called: FirebirdDEXProvider-2.0.2.exe.

Have you abandoned the Designer facility?