Hi,
I have a database (test) with one table (names) in it. I'm using MySQL 5.0.5, installed with WAMP.
In Visual Studio 2005 I'm trying to connect to this database.
I use the following code
However, I receive an error saying I can't establish a connection to the server (and when connecting to SQL Server 2005 -> default settings don't allow remote connections). However, In MySQL I can't find such a property.
I receive the same error when I'm using the following connection string
Can anybody help me please? I'm not sure if the syntax in visual basic is wrong, or if I'm missing an option in MySQL itself...
I have a database (test) with one table (names) in it. I'm using MySQL 5.0.5, installed with WAMP.
In Visual Studio 2005 I'm trying to connect to this database.
I use the following code
VB.NET:
Imports System.Data.SqlClient
Dim strConnection As String = "Data Source=localhost;User ID = marco; Password=marco; Initial Catalog=test"
Dim objConnection As SqlConnection = New SqlConnection(strConnection)
Try
objConnection.Open()
MessageBox.Show("connection ok")
objConnection.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
However, I receive an error saying I can't establish a connection to the server (and when connecting to SQL Server 2005 -> default settings don't allow remote connections). However, In MySQL I can't find such a property.
I receive the same error when I'm using the following connection string
VB.NET:
mySQLConnString = "Server=localhost;Database=test;Uid=marco;Pwd=marco;"
Can anybody help me please? I'm not sure if the syntax in visual basic is wrong, or if I'm missing an option in MySQL itself...