Hello
I seem to have a problem with a UPDATE that just does not want to work. Im simpled it down to the most simple UPDATE possible and it simply does not want to work. Here is the simple version:
public static string CambiarDatosUsuarios(string usuario,string contr,string pregunta,string respuesta,string correo)
{
string res;
try
{
comando = new MySqlCommand("UPDATE usuario SET pregunta=@preg,respuesta=@resp,email=@cor WHERE nombreu=@usud", conexion);
comando.Parameters.Add("@usud", MySqlDbType.VarChar, 50).Value = usuario.ToUpper();
comando.Parameters.Add("@preg", MySqlDbType.VarChar, 50).Value = pregunta;
comando.Parameters.Add("@resp", MySqlDbType.VarChar, 50).Value = respuesta.ToUpper();
comando.Parameters.Add("@cor", MySqlDbType.VarChar, 50).Value = correo;
AbrirConexion();
comando.ExecuteNonQuery();
comando.Parameters.Clear();
comando.Dispose();
res = "Usuario actualizado con excito";
}
catch (Exception ex)
{
res = ex.Message;
}
finally
{
CerrarConexion();
}
return res;
}
It gives NO errors but doesnt UPDATE any columns. I replaced it with a SELECT COUNT(*) and it works perfectly so I know I dont have column names or the table wrong.
If someone could help, thanks alot.