Protected Sub myDetailsView_ItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdateEventArgs) Handles myDetailsView.ItemUpdating
'*** CustomerID ***'
Dim txtCustomerID As TextBox = CType(myDetailsView.FindControl("txtEditCustomerID"), TextBox)
'*** Email ***'
Dim txtName As TextBox = CType(myDetailsView.FindControl("txtEditName"), TextBox)
'//Open Connection
conn.Connect()
'Execute Command mysql = "UPDATE authority_table SET mean_authority ='" & txtName.Text & "' WHERE id_authority='" & txtCustomerID.Text & "'"
'Create Connection
Dim mycommand As New Mysql.Data.MySqlClient.MySqlCommand(mysql, conn.myConnection)
mycommand.CommandType = Data.CommandType.Text
mycommand.CommandText = mysql
mycommand.ExecuteNonQuery()
MsgBox(" Save data Succesfully", MsgBoxStyle.Information, "Confirm!!")
myDetailsView.ChangeMode(DetailsViewMode.ReadOnly)
Me.BindData()
End Sub
มีปัญหาตรง คำสั่ง Update น่ะครับ แต่ข้อมูลสามารถ update ได้
จากนั้นแล้วบอกว่า " Object reference not set to an instance of an object. "