我試圖連接到一個數據庫,但它不工作...MySQL數據庫連接vb.net
代碼:
Dim conn As MysqlConnection
conn = New Mysqlconnection()
conn.ConnectionString = "server=http://www.*****.net/phpMyAdmin; user id=*****; password=****; database=login"
Try
conn.Open()
Catch myerror As MySqlException
MsgBox("Error connecting to database!")
End Try
它alsways說,錯誤連接到數據庫!
有什麼問題?
'再 conn.Open() 抓住myerror作爲個MySqlException MSGBOX(myerror.message) 結束Try' 這會給你更詳細的異常信息。 – Jack 2011-04-25 13:27:59