Frustration on creating TableAdapter using CoreLab PostgreSQLDirect for .Net

Frustration on creating TableAdapter using CoreLab PostgreSQLDirect for .Net

Postby albertlai » Thu 10 May 2007 00:05

I recently upgrade from Visual Studio 2003 to VS 2005 SP1 and upgrade the CoreLab PostgreSQLDirect provider to version 2.55.25 for VS2005. I find a very frustration problem:

Whenever I drag the table object from the Server Explorer in VS2005's dataset form, I receive the following message:
Failed to merge object(s).
Index was outside the bounds of the array..

The workaround method is to remove all primary keys and foreign keys from the PostgreSQL database. It should be fine if there are not too many tables in the database. This is annoying if I have many tables in the database. Can anyone here provide me better solution?

I am using PostgreSQL database version 7.4.17 running on Linux platform.

Thanks. :cry:
albertlai
 
Posts: 8
Joined: Wed 09 May 2007 23:41

Postby Alexey » Thu 10 May 2007 09:30

This problem doesn't seem to be OS-related. I can't reproduce it on using PostgreSQL on Windows. Does same happen with fresh solution and fresh dataset?
Did you use default installation options of PostgreSQLDirect .NET?
Try to reinstall PostgreSQLDirect .NET.
Try to debug the error using another instance of VS IDE.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby albertlai » Fri 11 May 2007 00:24

I use the default installation options of PostgreSQLDirect .NET

I re-install PostgreSQLDirect .NET but does not help.

I created a new solution, a new dataset in VS2005. Then I created 2 new tables, table1 and table2 in PostgreSQL database. Table1 had a primary key and table2 had a foreign key reference to a column in table1. I found the following scenario:

1. If I dragged table1 from Server Explorer to the dataset, the table adapter for table1 was created without any errors. Then I put table2, the process failed and returned the error I mentioned.

2. Then I removed table1 table adapter from step 1 and dragged table2 first. It worked for table2. But when I dragged table1 to the dataset, it came up with the same error.

3. I removed table2 from step 2. Then I highlighted table1 and table2 from Server Explorer at same time and dragged them onto the dataset. It worked this time but no relationship was created. After I tried to drag a new table table3 on to the dataset which contained table1 and table2 table adapters, the same error displayed again. Note that table3 was an independent table.

4. At last, I installed PostgreSQL version 8.2.4 for Windows on my PC and repeat above steps, they all work well without any errors.

It looks like there is a bug in CoreLab PostgreSQLDirect for VS2005 when accessing the previous version of PostgreSQL database. I do not have this problem when I use VS2003 with CoreLab PostgreSQLDirect version 2.55.25.

I also tried your latest CoreLab PostgreSQLDirect version 3.0 trial, I got the same problem.

What version of PostgreSQL database do you use?

Any other ideas to resolve this problem?
:(
albertlai
 
Posts: 8
Joined: Wed 09 May 2007 23:41

Postby Alexey » Fri 11 May 2007 07:00

I've reproduced this problem with PostgreSQL 7.x on Windows.
Now we are investigating it. I'll let you know our progress as soon as possible.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby albertlai » Thu 17 May 2007 05:23

Alexey wrote:I've reproduced this problem with PostgreSQL 7.x on Windows.
Now we are investigating it. I'll let you know our progress as soon as possible.


Hi Alexey,

Would you please tell me how long do you take to fix this problem?

Regards
Albert
albertlai
 
Posts: 8
Joined: Wed 09 May 2007 23:41

Postby albertlai » Thu 17 May 2007 05:29

Hi Alexey,

One other problem I did not mention. Even the PostgreSQLDirect can create the TableAdapter for a single table without displaying any errors, it does not create the insert, update and delete command automatically. Please also look at this problem. Many thanks.

Regards
Albert
albertlai
 
Posts: 8
Joined: Wed 09 May 2007 23:41

Postby Alexey » Thu 17 May 2007 06:50

Would you please tell me how long do you take to fix this problem?
We are working on providing a solution. Please wait a bit.
it does not create the insert, update and delete command automatically.
Does this happen with PostgreSQL 7.x only?
Insert command should be created in any case. Update and delete commands are to be created only if the table has a primary key. Please check this carefully.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby albertlai » Thu 17 May 2007 07:16

Alexey wrote:
Would you please tell me how long do you take to fix this problem?
We are working on providing a solution. Please wait a bit.
it does not create the insert, update and delete command automatically.
Does this happen with PostgreSQL 7.x only?
Insert command should be created in any case. Update and delete commands are to be created only if the table has a primary key. Please check this carefully.


This problem happens on PostgreSQL 7.x only.

If the table hasn't got primary key, it only generates SELECT command. I can only test the table without primary key because if there is a primary key, it fails to create the TableAdapter at all.

Albert
albertlai
 
Posts: 8
Joined: Wed 09 May 2007 23:41

Postby Alexey » Thu 17 May 2007 08:38

If the table hasn't got primary key, it only generates SELECT command. I can only test the table without primary key because if there is a primary key, it fails to create the TableAdapter at all.
Unfortunately, I cannot reproduce this problem. Please provide me with your database objects definitions.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby Alexey » Mon 21 May 2007 09:08

We have fixed the problem reported on Thursday, May 10, 2007.
Look forward to the next build.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby albertlai » Tue 22 May 2007 06:01

Alexey wrote:We have fixed the problem reported on Thursday, May 10, 2007.
Look forward to the next build.


Thanks. When can I download the new version?
albertlai
 
Posts: 8
Joined: Wed 09 May 2007 23:41

Postby Alexey » Tue 22 May 2007 07:18

This week, hopefully.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby albertlai » Thu 24 May 2007 01:45

Good work Alexey, the latest version 2.55.27 works fine, thanks.

Would you also fix version 3.x? It has the same problem too. I am considering upgrade to version 3 in the near future.
albertlai
 
Posts: 8
Joined: Wed 09 May 2007 23:41

Postby albertlai » Thu 24 May 2007 05:24

Sorry, I just find other problems.

1. The table adapter can be created only for the first table drag from Server Explore. The second table will generate the same error as mentioned, no matter the table has the relationship to the first table or not. It seems 2.55.27 build allow me to create one table adapter in one dataset only.

2. I can create more than one table adapters at a time. The trick is to select many table objects from Server Explorer and drag them to the dataset. Unfortunately, once those table adapters are created, I cannot create any other table adapters after.

3. The other problem is that the provider does not generate update and delete command in the table adapter even there is a primary key on the table.

Any ideas to resolve these problems?

:shock:
albertlai
 
Posts: 8
Joined: Wed 09 May 2007 23:41

Postby Alexey » Thu 24 May 2007 07:15

Unfortunately, I can't reproduce any problem.
Try to reinstall PostgreSQLDirect .NET.
Make sure that PostgreSQLDirect .NET isn't installed and there are no
CoreLab.* assemblies in the GAC.
After that install PostgreSQLDirect .NET again.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for PostgreSQL