Buenas tardes, un cordial saludo a todos, mi especialidad es la pogramación web, peroestoy desarrollando un website que tiene una aplicación de escritorio, ya logre hacer la conexión al MySql en modo local y cuando trato de hacerlo a mi hosting no sirve no se porque, ademas quiero mostar el nombre apellido de mi usuario en la aplicacón y no consigo como hacerlo, voy a dejar lo que he hecho a fin de que si alguien me puede colaborar o dandome una luz, se los agradecere mucho.
Código vb:
Ver originalImports MySql.Data.MySqlClient
Public Class Form1
Private Sub acceso_Click(sender As Object, e As EventArgs) Handles acceso.Click
If (Check(usuario.Text, password.Text)) Then
acceso.Hide()
usuario.Hide()
password.Hide()
label_login.Hide()
label_user.Hide()
label_password.Hide()
btn_home.Show()
btn_option.Show()
btn_fly.Show()
btn_inf.Show()
label_Conectando.Hide()
label_login.Hide()
label_pilot.Show()
label_name.Show()
label_surname.Show()
label_rank.Show()
label_location.Show()
label_budget.Show()
label_home.Show()
End If
End Sub
Function Check(ByVal usuario As String, ByVal password As String) As Boolean
Dim oConexion As New MySqlConnection
Dim oDataAdapter As MySqlDataAdapter
Dim oDataset As New DataSet
Dim sSql As String
Dim sw As Boolean = False
Try
oConexion.ConnectionString = "server=localhost;database=fsamanager;Uid=root;Pwd="
sSql = "SELECT pilots.name FROM pilots WHERE username='" & usuario & "' and password='" & password & "'"
oConexion.Open()
oDataAdapter = New MySqlDataAdapter(sSql, oConexion)
oDataset.Clear()
oDataAdapter.Fill(oDataset, "pilots")
If (oDataset.Tables("pilots").Rows.Count <> 0) Then
sw = True
Else
MessageBox.Show("Usuario / contraseña invalida", "sistema")
sw = False
End If
Catch ex As Exception
End Try
Return (sw)
End Function
Private Sub label_Conectando_Click(sender As Object, e As EventArgs) Handles label_Conectando.Click
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles btn_fly.Click
End Sub
Private Sub btn_salir_Click(sender As Object, e As EventArgs) Handles btn_salir.Click
Close()
End Sub
Private Sub btn_home_Click(sender As Object, e As EventArgs) Handles btn_home.Click
End Sub
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles label_pilot.Click
End Sub
Private Sub Label1_Click_1(sender As Object, e As EventArgs) Handles label_home.Click
End Sub
Private Sub btn_option_Click(sender As Object, e As EventArgs) Handles btn_option.Click
label_home.Hide()
label_options.Show()
End Sub
Private Sub Label1_Click_2(sender As Object, e As EventArgs) Handles label_options.Click
End Sub
Private Sub password_TextChanged(sender As Object, e As EventArgs) Handles password.TextChanged
End Sub
Private Sub Label1_Click_3(sender As Object, e As EventArgs) Handles text_name.Click
End Sub
Private Function oDataAdapter(p1 As String) As Object
Throw New NotImplementedException
End Function
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles text_nombre.TextChanged
End Sub
End Class