3
I have this code that runs an SQL:
strsql = "select Nome, Senha from users where Nome=@field1 and Senha=@field2"
objcmd = New Data.MySqlClient.MySqlCommand(strsql, objconn)
With objcmd
.Parameters.AddWithValue("@field1", "valor1")
.Parameters.AddWithValue("@field2", "valor2")
End With
objcmd.ExecuteNonQuery()
objdr = objcmd.ExecuteReader
If (objdr.Read()) Then
MsgBox("Sucesso.")
Else
MsgBox("Erro desconhecido.")
End If
objcmd.Dispose()
objdr.Close()
I want to know, how can I get a value, for example the Name and put into a variable (take the value of the column and move to a string)?