private void button1_Click(object sender, EventArgs e)
{
string sql = "UPDATE ALUNO SET NOME=" +
txtNome.Text +
",ENDERECO =" + txtEndereco.Text;
// "'NUMERO_MATRICULA ='" + txtNumMatricula.Text + "', " +
// "NUMERO_CONTRATO='" + txtNumContrato.Text;
SqlConnection con = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand(sql, con);
cmd.CommandType = CommandType.Text;
con.Open();
try
{
int i = cmd.ExecuteNonQuery();
if (i <= 1)
MessageBox.Show("Cadastro atualizado com sucesso!");
}
catch (Exception ex)
{
MessageBox.Show("Erro: " + ex.ToString());
}
finally
{
con.Close();
}
Qual erro retorna?