2016-11-23 56 views
1

暗淡康恩作爲的MySqlConnection如何連接vb.net thorgh在線phpmyadmin的

conn = New Mysqlconnection() 
conn.ConnectionString = "server=justhost.com; user id=*****; password=****; database=login" 

Try 
    conn.Open() 
Catch myerror As MySqlException 
    MsgBox("Error connecting to database!") 
End Try 

這個代碼不工作?如何連接在線phpmyadmin數據庫使用vb.net?

回答

0

你試過安裝這個嗎?

http://dev.mysql.com/downloads/connector/net/

和安裝在此之後,嘗試重新配置你的代碼試試這個。

Imports MySql.Data.MySqlClient 

Dim Connection As MySqlConnection = New MySqlConnection() 
Dim ConnectionString As String = "Server=SERVERNAME or the Database online link;Database=DATABASE;Uid=root;Pwd=password;" 
Connection.ConnectionString = ConnectionString 
Connection.Open() 

//Execute here what ever you want just follow your heart <3 

myConnection.Close() 
+0

我可以發送視頻教程嗎?謝謝 – Duminda