InsertID always 0?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
vincentfitzg
Posts: 10
Joined: Wed 27 Jul 2005 11:36

InsertID always 0?

Post by 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

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 21 Jun 2006 09:07

We reproduced the bug and now fixing it.
Look forward to the next build.

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

Post by vincentfitzg » Wed 21 Jun 2006 10:39

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

Vince

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 21 Jun 2006 11:09

We are going to make a new build in a week.

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

New Build

Post by vincentfitzg » Fri 30 Jun 2006 08:21

Any update on when the new build is available?

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by 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.

Post Reply