i have already read a ton of posts about connecting vb 2010 express to Mysql in Wamp, but none solved my problem :P.
The thing is that i have a local Mysql server running, to which i do connect with no problems in PHP and MySQL Workbench, but when i tried to connect with vb 2010 express i found out i had to Import the connector and then build the code accordingly.
I think my code is ok, but still getting the message “WindowsApplication1.vshost.exe Error: 0 : Access denied for user ‘root’@’localhost’ (using password: YES)”
Here’s the code:
Private Sub CheckPayments()
Try
myPassword = ""
myConnstr = "Server=localhost;Database=kiosk;Uid=root;Pwd=myPassword"
myQuery = "select * from products where deleted = 0"
Dim myConn As New MySqlConnection(myConnstr)
Dim myDa As New MySqlDataAdapter(myQuery, myConn)
If myDa.Fill(myDs) Then ' 1 significa que a ligação foi efetuada com sucesso
mysqldump.DataSource = myDs.Tables(0)
End If
myConn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Stuck in project with this error, need help quick !!
Thanks in advance for any help you can give me 🙂
BR, Carlos Mendes
hope this helps out someone who needs to connect VB2010 Express to MySQL.
This code displays MySQL data in a DataGridView object. Connections problem solved :).