error when trying to write to the database

error when trying to write to the database

Postby 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

Postby 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!
ddepuemd
 
Posts: 2
Joined: Tue 09 Nov 2004 19:32

Re: error when trying to write to the database

Postby 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.
Oleg
Devart Team
 
Posts: 264
Joined: Thu 28 Oct 2004 13:56


Return to dotConnect for MySQL

Copyright © 1998 - 2017 Devart. All rights reserved.