0
我收到此錯誤:「從流中讀取失敗。」mysql與vbnet的遠程連接
下面是我的代碼:
Imports MySql.Data.MySqlClient
Public Class Form1
Dim dbds As New DataSet
Dim MySQLconn As New MySqlConnection
Dim SQLda As New MySqlDataAdapter
Dim cmd As MySqlCommand
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MySQLconn = New MySqlConnection("server=www.address.com;User Id=user_nem;pwd=***;port=2082;database=db_db_db")
Try
MySQLconn.Open()
MsgBox("Sucess, press ok to continue…", vbOKOnly)
cmd.CommandText=(("set net_write_timeout=99999; set net_read_timeout=99999"), MySQLconn)
cmd.ExecuteNonQuery()
SQLda = New MySqlDataAdapter(("SELECT * FROM log_in"), MySQLconn)
SQLda.Fill(dbds, "doctors")
DataGridView1.DataSource = dbds.Tables("doctors")
Catch ex As Exception
MsgBox(Err.Description)
End Try
End Sub
End Class
此代碼工作正常與我的本地主機。 任何幫助將不勝感激。謝謝。