I have the following SQL string in a string to update tables from textBox.
string actualizar = "update pelicula set nombre_pelicula = " + txtnombre.Text.Trim() + " , web_pelicula = " + txtweb.Text.Trim() + " , descripcion = " + txtdescripcion.Text.Trim() + " , anio = " + txtanio.Text.Trim() + "where id_pelicula = " + txtid.Text.Trim();
SqlCommand comando = new SqlCommand(actualizar, conexion);
SqlDataReader dr = comando.ExecuteReader();
//comando.ExecuteNonQuery();
if (dr.Read())
{
MessageBox.Show("Se actualizo correctamente");
conexion.Close();
}
But with the time to modify the elements I get the following error:
where line 84 is:
SqlDataReader dr = comando.ExecuteReader();
Also when I replace this line with:
comando.ExecuteNonQuery();
Keep giving the error