I try to bind a mysql database to a datagridview in VB.NET 2010 but I get an error:
Me.dataAdapter.Fill(table)
Error 40 MYSQL Named Pipeline
When I try to put the MYSQL directly to a datagridview, it works flawlessly.
When I TRY TO PUT THE mysql database to a bindingobject, I get the error.
Remote Access has been enabled, the connectionstring is 1:1 the same so it should work.
How can I solve the problem?
Dim selectCommand As String = "SELECT * FROM `test`"
Dim connectionString As String = "Server="sXX.XXXXX.host;User Id=wXXX;Password=tXXXX;Database=aXXXX";
' Create a new data adapter based on the specified query.
Me.dataAdapter = New SqlDataAdapter(selectCommand, connectionString)
' Create a command builder to generate SQL update, insert, and
' delete commands based on selectCommand. These are used to
' update the database.
Dim commandBuilder As New SqlCommandBuilder(Me.dataAdapter)
' Populate a new data table and bind it to the BindingSource.
Dim table As New DataTable()
table.Locale = System.Globalization.CultureInfo.InvariantCulture
Me.dataAdapter.Fill(table)
Me.bindingSource1.DataSource = table
' Resize the DataGridView columns to fit the newly loaded content.
Me.DataGridView1.AutoResizeColumns(
DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader)
Me.DataGridView1.DataSource = Me.bindingSource1
What I have tried:
I tried to check for remote access ALLOWANCE and it is enabled. I double check the connection string and it is 1:1 the same like when I try to bind mysql database directly to a datagridview