0
Private Sub btnSelectAsset_Click(sender As Object, e As EventArgs) Handles btnSelectAsset.Click
MySqlConn = New MySqlConnection
MySqlConn.ConnectionString =
"server=localhost;userid=root;password= ;database=myma"
Dim SDA As MySqlDataAdapter
Dim dbDataSet As New DataTable
Dim bSource As New BindingSource
Try
MySqlConn.Open()
COMMAND.Connection = MySqlConn
SDA = New MySqlDataAdapter("select * from myma.user", MySqlConn)
dbDataSet = New DataTable
SDA.Fill(dbDataSet)
DataGridView1.DataSource = dbDataSet
MySqlConn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
MySqlConn.Dispose()
End Try
End Sub
對象引用不設置爲一個對象的實例的對象的一個實例。對象引用不設置到
調試時出現上述錯誤。你能幫我解決這個問題嗎?
你哪一行出錯? –
沒有指定行 – luckydzs
請調試並檢查哪條線路出現錯誤。 –