Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/05/2015, 13:05
grossbergsteven
 
Fecha de Ingreso: diciembre-2014
Mensajes: 69
Antigüedad: 10 años, 1 mes
Puntos: 2
Vb.net y MySql

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 original
  1. Imports MySql.Data.MySqlClient
  2. Public Class Form1
  3.  
  4.     Private Sub acceso_Click(sender As Object, e As EventArgs) Handles acceso.Click
  5.         If (Check(usuario.Text, password.Text)) Then
  6.             acceso.Hide()
  7.             usuario.Hide()
  8.             password.Hide()
  9.             label_login.Hide()
  10.             label_user.Hide()
  11.             label_password.Hide()
  12.             btn_home.Show()
  13.             btn_option.Show()
  14.             btn_fly.Show()
  15.             btn_inf.Show()
  16.             label_Conectando.Hide()
  17.             label_login.Hide()
  18.             label_pilot.Show()
  19.             label_name.Show()
  20.             label_surname.Show()
  21.             label_rank.Show()
  22.             label_location.Show()
  23.             label_budget.Show()
  24.             label_home.Show()
  25.         End If
  26.     End Sub
  27.     Function Check(ByVal usuario As String, ByVal password As String) As Boolean
  28.         Dim oConexion As New MySqlConnection
  29.         Dim oDataAdapter As MySqlDataAdapter
  30.         Dim oDataset As New DataSet
  31.         Dim sSql As String
  32.         Dim sw As Boolean = False
  33.         Try
  34.             oConexion.ConnectionString = "server=localhost;database=fsamanager;Uid=root;Pwd="
  35.             sSql = "SELECT pilots.name FROM pilots WHERE username='" & usuario & "' and password='" & password & "'"
  36.             oConexion.Open()
  37.             oDataAdapter = New MySqlDataAdapter(sSql, oConexion)
  38.             oDataset.Clear()
  39.             oDataAdapter.Fill(oDataset, "pilots")
  40.  
  41.             If (oDataset.Tables("pilots").Rows.Count <> 0) Then
  42.                
  43.                 sw = True
  44.             Else
  45.                 MessageBox.Show("Usuario / contraseña invalida", "sistema")
  46.                 sw = False
  47.             End If
  48.         Catch ex As Exception
  49.         End Try
  50.         Return (sw)
  51.     End Function
  52.  
  53.     Private Sub label_Conectando_Click(sender As Object, e As EventArgs) Handles label_Conectando.Click
  54.  
  55.     End Sub
  56.  
  57.     Private Sub Button4_Click(sender As Object, e As EventArgs) Handles btn_fly.Click
  58.  
  59.     End Sub
  60.  
  61.     Private Sub btn_salir_Click(sender As Object, e As EventArgs) Handles btn_salir.Click
  62.         Close()
  63.     End Sub
  64.  
  65.     Private Sub btn_home_Click(sender As Object, e As EventArgs) Handles btn_home.Click
  66.  
  67.     End Sub
  68.  
  69.     Private Sub Label1_Click(sender As Object, e As EventArgs) Handles label_pilot.Click
  70.  
  71.     End Sub
  72.  
  73.     Private Sub Label1_Click_1(sender As Object, e As EventArgs) Handles label_home.Click
  74.  
  75.     End Sub
  76.  
  77.     Private Sub btn_option_Click(sender As Object, e As EventArgs) Handles btn_option.Click
  78.         label_home.Hide()
  79.         label_options.Show()
  80.     End Sub
  81.  
  82.     Private Sub Label1_Click_2(sender As Object, e As EventArgs) Handles label_options.Click
  83.  
  84.     End Sub
  85.  
  86.     Private Sub password_TextChanged(sender As Object, e As EventArgs) Handles password.TextChanged
  87.  
  88.     End Sub
  89.  
  90.     Private Sub Label1_Click_3(sender As Object, e As EventArgs) Handles text_name.Click
  91.  
  92.     End Sub
  93.  
  94.     Private Function oDataAdapter(p1 As String) As Object
  95.         Throw New NotImplementedException
  96.     End Function
  97.  
  98.     Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles text_nombre.TextChanged
  99.  
  100.     End Sub
  101. End Class