I keep getting this error message: DataReader associated with this connection must be closed first. Here's an example of the code I'm running:
these methods are being executed approximated 2 or 3 times per second and I have them running on separate threads.
MySqlConnection conn = new MySqlConnection(conString);
MySqlCommand cmd = new MysqlCommand();
conn.Open();
cmd.Connection = conn;
public void Insert(string name)
{
cmd.CommandText = String.Format("Insert Into tbl (id,name) Values (Null,'{0}')", name);
cmd.ExecuteNonQuery();
}
public void Update(string name)
{
cmd.CommandText = String.Format("Update Into tbl_2 Set name = '{0}'", name);
cmd.ExecuteNonQuery();
}
these methods are being executed approximated 2 or 3 times per second and I have them running on separate threads.