Does not my form keep the new values when updating?

0

I have the following problem, in my form when doing UPDATE it does not save the new values, it keeps those that have already been loaded in the text boxes, any idea of why it happens?

I'm working on ASP.NET with VB

    Dim con As New MySqlConnection
    Dim cmd As New MySqlCommand
    Dim sql As String
    sql = "Update tbl_registros SET n1=" & n1 & ",n2=" & n2 & ",n3=" & n3 & ",n4=" & n4 & ",apellido_paterno='" & apaterno & "',apellido_materno='" & amaterno & "'," & vbCrLf &
          "nombre='" & nombre & "',edad=" & edad & ",calle='" & calle & "',numero=" & numero & ",colonia='" & colonia & "',seccion=" & seccion & ",telefono='" & telefono & "',celular='" & celular & "',facebook='" & red_social & "',email='" & email & "'" & vbCrLf &
          "Where id=" & id
    con.ConnectionString = "Server=localhost;Database=bd_votacion; Uid=root;Pwd='';"
    con.Open()
    cmd.Connection = con
    cmd.CommandText = sql
    cmd.ExecuteNonQuery()
    con.Close()

function "update" with the values of the parameters:

update (id, txtn1.Text, txtn2.Text, txtn3.Text, txtn4.Text, txtApaterno.Text, txtamaterno.Text, txtNombre.Text, txtedad.Text, txtcalle.Text, txtnumero.Text, txtcolonia.Text , txtseccion.Text, txttelefono.Text, txtcelular.Text, txtredsocial.Value, txtemail.Text)

    
asked by Erasmo Cervantes Olivas 10.03.2018 в 18:14
source

0 answers