Imports MySql.Data.MySqlClient
Public Class LoginForm1
Dim Connection As MySqlConnection = New MySqlConnection("server=10.0.0.74; user id=root; password=123; database=dev")
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
RunQ("SELECT * FROM tbl_contacto WHERE email_contacto='" & UsernameTextBox.Text & "'and contra='" & PasswordTextBox.Text & "'")
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub
Public Sub RunQ(ByRef stringtorun As String)
Try
Connection.Open()
Dim StrQuerry As New MySqlCommand(stringtorun, Connection)
MsgBox("Consulta ok")
Connection.Close()
Catch ex As MySqlException
MsgBox(ex.Message)
End Try
End Sub
End Class
como puedo sacar el resultado de la consulta para despues comparar con un if, en php lo hacia asi:
Código PHP:
Ver original
echo"error"; }else{ echo"Logeo con exito"; }
pero en .NET como lo saco