I'm getting very strange problems with the MySQLDataTable (3.5 beta) working with simple primary keys.
I have a simple table with a primary key called 'ID' which is non-null autoincrementing integer. I create a row manually using the db editor. Now I write a simple program that does a "SELECT * FROM mytable".
I add a row in code, and go to update. It comes back with an error because the MySQLDataTable component is not incrementing the primary key 'ID' to 2, and in instead trying to use 1.
Another scenario:
I have a table with 100 records, again a primary key of 'ID'. I run a query "SELECT * FROM mytable WHERE field1 = 'xxx'" which returns records #'d 30-40.
I try to add a row to the resulting datatable. It fails because it is trying to use a primary key value of '41'.
Anybody else run into this problem. The MySQLDataTable is a dream for fast coding when it works, but these problems are unacceptable for using it.
DataTables and autoincrement on primary keys
-
- Posts: 38
- Joined: Tue 07 Mar 2006 17:13
-
- Posts: 38
- Joined: Tue 07 Mar 2006 17:13