0
SQL connection
I am using VB.net how can I connect to wampp server
1 Antwort
0
You must do the steps bellow:
- download Mysql connector/net
- import the mysql.data.dll to your project
Now you can try this code:
Dim conn As New MySql.Data.MySqlClient.MySqlConnection
Dim myConnectionString as String
myConnectionString = "server=127.0.0.1;" _
& "uid=root;" _
& "pwd=12345;" _
& "database=test;"
Try
conn.ConnectionString = myConnectionString
conn.Open()
Catch ex As MySql.Data.MySqlClient.MySqlException
MessageBox.Show(ex.Message)
End Try
From: https://dev.mysql.com/doc/connector-net/en/connector-net-programming-connecting-open.html