Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8660891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:22:16+00:00 2026-06-12T16:22:16+00:00

i have already read a ton of posts about connecting vb 2010 express to

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:22:17+00:00Added an answer on June 12, 2026 at 4:22 pm

    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 :).

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)  Handles Button1.Click
        Dim con As MySqlConnection = New MySqlConnection("Data Source=localhost;Database=<your db>;User ID=<your user>;Password=<your password>;")
        Dim sql As MySqlCommand = New MySqlCommand("SELECT * FROM <your table>", con)
    
        Dim ds As DataSet = New DataSet()
    
        Dim DataAdapter1 As MySqlDataAdapter = New MySqlDataAdapter()
    
        con.Open()
    
        DataAdapter1.SelectCommand = sql
    
        DataAdapter1.Fill(ds, "<DataGridView table name>")
    
        DataGridView1.DataSource = ds
    
        DataGridView1.DataMember = "<DataGridView table name>"
    
        con.Close()
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already read some posts, but no one helped me with my problem.
I have already read all the previous similar posts but I couldn't find a
I have already read a lot of posts around this subject but I am
I have already read some info about his issue on the web, but I
I have already read Josh Smiths article about binding commands to view model using
I have already read some articles and searched on Google, but I failed to
I have already read the hibernate docs about concurrency and I think, I have
I have already read this web page http://api.jquery.com/end/ but I am still clueless on
I have already read this post , but I am not sure know to
I have already read the Instapaper API page , but it only explains how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.