Dim nombre As String
Dim direccion As String
Dim telefono As String
Dim id As String
id = CType(e.Item.Cells(2).Controls(0), TextBox).Text
nombre = CType(e.Item.Cells(3).Controls(0), TextBox).Text
direccion = CType(e.Item.Cells(4).Controls(0), TextBox).Text
telefono = CType(e.Item.Cells(5).Controls(0), TextBox).Text
UPDATECommand.CommandText = "UPDATE contactos SET nombre= @nombre, direccion = @direccion, telefono =@telefono WHERE id = @id"
UPDATECommand.Parameters.Add("@id", OleDb.OleDbType.VarChar, 11).Value = id
UPDATECommand.Parameters.Add("@nombre", OleDb.OleDbType.VarChar, 11).Value = nombre
UPDATECommand.Parameters.Add("@direccion", OleDb.OleDbType.VarChar, 40).Value = direccion
UPDATECommand.Parameters.Add("@telefono", OleDb.OleDbType.VarChar, 20).Value = telefono
Conexion.Open()
UPDATECommand.Connection = Conexion
UPDATECommand.ExecuteNonQuery()
DataGrid1.EditItemIndex = -1
DataGrid1.DataBind()
Conexion.Close()
End Sub
Este es mi codigo, saque el string de coneccion para que no sea tan extenso. No me actualiza los cambios en la base.
Y CUANDO LO DEBUGEO, me doy cuenta de que los text.box no levantan los cambios....
QUE TENGO MALLLLL????????????
