UPDATE VISUAL BASIC
Publicado por juan (1 intervención) el 02/07/2021 08:04:33
Muy buenas.
El select me lo hace bien, pero el update no.
Por privacidad no puedo poner mi servidor, pero esta puesto bien.
¿Alguien me puede ayudar?
El select me lo hace bien, pero el update no.
Por privacidad no puedo poner mi servidor, pero esta puesto bien.
¿Alguien me puede ayudar?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Public Sub conectate(usuario As String, password As String, Optional visible As Boolean = False)
Dim connString As String = "server=(PRIVACIDAD);Port=(PRIVACIDAD); user id=(PRIVACIDAD); password=(PRIVACIDAD); database=(PRIVACIDAD)"
Dim sqlConn As New MySqlConnection(connString)
Dim sqlQuery As String = "SELECT etiqueta,id,cont,capacidad FROM contenedores "
Using sqlConn
Using sqlComm As New MySqlCommand()
With sqlComm
.Connection = sqlConn
.CommandText = sqlQuery
.CommandType = CommandType.Text
End With
Try
sqlConn.Open()
Dim sqlReader As MySqlDataReader = sqlComm.ExecuteReader()
While sqlReader.Read()
Dim cont = sqlReader("cont").ToString()
Dim capacidad = sqlReader("capacidad").ToString()
MessageBox.Show(cont)
End While
Dim update_command As New MySqlCommand("UPDATE `contenedores` SET `tipo` ='prueba' where `id`='147'", sqlConn)
sqlConn.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
End Try
End Using
End Using
Valora esta pregunta


0