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
error when trying to write to the database
error
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!
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!
Re: error when trying to write to the database
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.