Error MYSQL Login

(1/1)

carlosuc99:
Buenas,

Uso Visual Stuido Ultimate 2012. Y el MYSQL Connector v4 (el último). Tengo este código. Si necesitáis código anterior pedirlo:

Código
Dim sqlQuery = "SELECT * FROM Pilots Where License = '" + UsernameTextBox.Text + "' AND Password = '" + PasswordTextBox.Text + "' "
       Dim myCommand As New MySqlCommand()
       myCommand.Connection = connection
       myCommand.CommandText = sqlQuery
 
       myAdapter.SelectCommand = myCommand
       Dim myData As MySqlDataReader()
       myData = myAdapter.ExecuteReader()
 
       If myData.HasRows = 0 Then
           MsgBox("Invalid User/Password!")
       Else
           MainForm.Show()
           Me.Close()
       End If
 

Y me da estos errores:

Citar

Error 1 'ExecuteReader' is not a member of 'MySql.Data.MySqlClient.MySqlDataAdapter'. E:\VARS Client\VARS Client\VARS Client\Login.vb 26 18 VARS Client

Error 2 'HasRows' is not a member of 'System.Array'. E:\VARS Client\VARS Client\VARS Client\Login.vb 28 12 VARS Client

Me podéis ayudar?

.::IT::.:
Utiliza un MysqlDataAdapter de la siguiente manera

Dim myDt As MysqlDataAdapter(myCommand)

Dim dt AS new DataTable()

myDt.FillDr(dt)

if(dt.Rows.Count =0 )


Espero te sirva no tengo un compilador a la mano y no puedo probarlo

Navegación

[0] Índice de Mensajes