error when trying to write to the database

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
ddepuemd
Posts: 2
Joined: Tue 09 Nov 2004 19:32

error when trying to write to the database

Post by ddepuemd » Tue 09 Nov 2004 19:35

i keep getting this error:

Commands out of sync; You can't run this command now

does anyone know what this is???

I need to get this going soon!

Thanks,
Dean

ddepuemd
Posts: 2
Joined: Tue 09 Nov 2004 19:32

error

Post by ddepuemd » Tue 09 Nov 2004 19:38

by the way, this is my simple commands:

Dim sql As String
sql = "update set = 1"
Dim mysql As New CoreLab.MySql.MySqlCommand
mysql.CommandText = sql
mysql.Connection = connection
mysql.Connection.Open()
mysql.ExecuteNonQuery()
connection.Close()

connection works, which is just the string to connect. it fails on the executenonquery statement no matter how I construct the sql.

HELP!

Oleg
Devart Team
Posts: 264
Joined: Thu 28 Oct 2004 13:56

Re: error when trying to write to the database

Post by Oleg » Wed 10 Nov 2004 08:22

This exception raises if you have open DataReader constrained with the connection. Make sure that you always close DataReader in your code. Use Try - Finally clause for closing your DataReader objects.

Post Reply