Page 1 of 1

InsertID always 0?

Posted: Wed 21 Jun 2006 08:33
by vincentfitzg
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

Posted: Wed 21 Jun 2006 09:07
by Alexey
We reproduced the bug and now fixing it.
Look forward to the next build.

Posted: Wed 21 Jun 2006 10:39
by vincentfitzg
Thanks for the quick reply.
When do you think it will be available?

Vince

Posted: Wed 21 Jun 2006 11:09
by Alexey
We are going to make a new build in a week.

New Build

Posted: Fri 30 Jun 2006 08:21
by vincentfitzg
Any update on when the new build is available?

Posted: Fri 30 Jun 2006 11:18
by Alexey
We have fixed the bug. New build should be available for download in the beginning of the next week.