DataTable : Major problem with cell edit

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Posts: 11
Joined: Wed 11 Feb 2009 02:14

DataTable : Major problem with cell edit

Post by jkanerva » Tue 11 May 2010 08:30

1. I have a major problem with DataTable since 7/2009. Basic stuff does not properly work at all. Is anyone using it :shock: ? What is wrong with this ?

I upgraded to Pro in 7/2009. Atleast since then the Datatable editing does not work. It is useles. After more 100 h of work I could not get it working.

The DataTable is binded to postgres DB OK. When I enter a string field , it has char 48 lenght in pg, the cell editor do not work properly.

When I click the whole cell is highlighted. The cursor is at the most right position.The contents is name + left padding blancos up to 48 chars. Like 'Anna............................'. Because the visual column can show only 30 chars I can see '....................|'. I have to use left arror to find Anna text.

If I just click the cell or enter edit state I have to delele 6 chars after Anna to be able to add even 1 char .

If I just go to position after Anna and I enter more text I get DataError because the cell is more than 48 chars >maxLenght. The editor do not cut the entry to 48 chars. Unicode is used which is another problem, but in this case (Anna) it does not incluence.

If I limit the Max Lenght from default 32767 to 40 if DataGridView, the editor operates even crazier. And if I limit the DataTable [collection]'s property lenght from -1 it makes the same error. The input is always too long and gives DataError.

The Devartdata.postgres.dll is v is is

It is like the parameters are not compatible with software.
Are the versions ok ?

I am not going to upgrade Devart package before I can see this works.

2. The Other problem is related to having 2 different versions of the postgres data base ( old and new). The new has more column and longer name field (48, old is 40). I want to use one DataGridView1 and bind it to DataTable1 or DataTable2 after I have started the application according to setups in prog.ini file. I can do that and the application test is using it. Is this the right way to select datasource ( to bind it) and turn the DataGridView Column visual to False for not used data columns= PG table fields ?

3. Also I can not even solve this problem by creating my own cell editor. It should already work.
-How can I even read the real current database field lenght to limit the entry ?
I was planning of buying a commercial datagrideditor package, but it operates if DataSet is used and I think I can not use that.
( or
( ... ender.html).
Any suggestions which works. The .NET version is limited.

4. The documentation does not describe all the parameters of DataTable and related [collection] parameters. So it is alchemy and crazy to test all combinations.

5. If the 'use pg data types' in DataTable design in VS2008 is set to true , it removes the databindings immediately without warning and there is no undo. You just destroys hours of work. I do not even know how it does because of the lack of information.

Posts: 11
Joined: Wed 11 Feb 2009 02:14


Post by jkanerva » Tue 11 May 2010 12:02

The Postgres SQL server is version 8.4 running on Vista 64 bit. No secure connection. Tested with 'localhost' and remotely on Win XP and Vista PC.

I also tested with PG server 8.3 on XP locally and it resulted the same.

Posts: 11
Joined: Wed 11 Feb 2009 02:14

Where is the field lenght variable in DataTable dataset ?

Post by jkanerva » Sun 16 May 2010 14:44

I can not find from the document where is the lenght of a CHAR or VARCHAR field of a DataTAble Dataset.

So which is the variable that stores the lenght of a CHAR field ?
( and property of the other variables )

Somehow DataTable reads this from the DB. Now I need to cut the string into correct lenght. I have to mkake an event handler for endedit or similar. I hope to check the current edit property for cell.

Somehow there is an dataerror if the datatableview string input field is too long. Perhaps dotConnect should cut too long fields ?

I have a .connect_pg_pro subscription.

New features : It could be handly if devart package DataTable would have a way to print and export(/import) to XLS and to CSV file.

Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Mon 17 May 2010 16:59

1. Could you please describe the way you are modifying data in more details? I've tried to reproduce the problems with editing data with both 4.55.37 and 4.90.124 versions of dotConnect for PostgreSQL in the following editors (points 1.a - 1.b) : Server Explorer -> Show Table Data, Devart DataTable Editor, and the data grid in the compiled application.

a. When editing a cell, jumping to the latter symbols is the standard behaviour of a data grid.
b. I failed to reproduce the problem with adding a single symbol after 'Anna'.
c. If I add several symbols after 'Anna' (so that their common count is less than 48), the row is updated successfully. If symbols common count is greater than 48, it is the standard MS behaviour to show a warning and cancel the update command.
d. By the 'Max Length' property of DataGridView, did you mean the MaxInputLength property of the Columns collection? I couldn't reproduce the problem changing it. The MaxLength property of DataTable's Columns collection cannot be set to 40 as DataTable contains a record with 48 characters, and this is the expected behaviour.
e. The Devart.Data.PostgreSql.Entity assembly should be of version 4.55.37; to resolve the problem, please try re-installing dotConnect for PostgreSQL. Please tell us if this helps.

2. You are right: setting the excess columns to be invisible you will have the same view for older and newer tables. Please tell us if you are encountering any problems with this.

3. a. To get the claimed length (like 48 in character(48)), you should retrieve the metadata for the corresponding table. For details, please see ... aData.html
If you need the actual size of the field, you may, e.g., trim it ( String.Trim() ).

b. dotConnect for PostgreSQL provides several types of DataSets: untyped PgSqlDataSets, which are the instances of the PgSqlDataSet class, and typed PgSqlDataSets, which are classes generated in either MS DataSet Designer or Devart DataSet Wizard. For more information on DataSets, please refer to ... cepts.html ... izard.html ... nager.html

Please specify the problems (if any) you are encountering using either type.

4. We are working on our documentation. We would be very obliged to you if you specify what our documentation lacks, and which exact features or concepts should have better description.

5. Did you mean the ReturnProviderSpecificTypes property? Could you please specify the exact steps needed to reproduce the problem in details? I.e., which objects should be created and what should be done with their properties to drop data bindings?

Also, a small test project would be very helpful.

6. The field length can be changed via the DataTable.Columns[index].MaxLength property. However, when a data table is filled, the metadata is retrieved from the database. If the metadata settings does not correspond to the MaxLength property, the table will not be filled.

7. Cutting too long fields will be non-transparent for users. The common approach is to warn that the value cannot be inserted and cancel the operation.

8. The XML import/export is available for the PgSqlDataSet class. The corresponding methods (GetXML/ReadXML) are inherited from System.Data.DataSet. Please tell us if you are encountering any problems using these methods or if they lack some functionality which is critical for your tasks.

Post Reply