InsertID always 0?

InsertID always 0?

Postby vincentfitzg » Wed 21 Jun 2006 08:33

Hello,
I'm using MySQL Version 5.0.19 and CoreLab.MySQL Version 3.5.3.0

When I try the following code I alway receive an InsertId of 0 although the record is inserted into the db and the primary key is increased correctly, does anybody know why?

Code:
MySqlCommand command = new MySqlCommand();
command.Connection = new MySqlConnection( connectionString );
MySqlTransaction transaction = command.Connection.BeginTransaction();
command.Transaction = transaction;

command.CommandText = "INSERT INTO Layers SET ...";
command.ExecuteNonQuery();
transaction.Commit();
int index = (int)command.InsertId;

Vince
vincentfitzg
 
Posts: 10
Joined: Wed 27 Jul 2005 11:36

Postby Alexey » Wed 21 Jun 2006 09:07

We reproduced the bug and now fixing it.
Look forward to the next build.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby vincentfitzg » Wed 21 Jun 2006 10:39

Thanks for the quick reply.
When do you think it will be available?

Vince
vincentfitzg
 
Posts: 10
Joined: Wed 27 Jul 2005 11:36

Postby Alexey » Wed 21 Jun 2006 11:09

We are going to make a new build in a week.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

New Build

Postby vincentfitzg » Fri 30 Jun 2006 08:21

Any update on when the new build is available?
vincentfitzg
 
Posts: 10
Joined: Wed 27 Jul 2005 11:36

Postby Alexey » Fri 30 Jun 2006 11:18

We have fixed the bug. New build should be available for download in the beginning of the next week.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL