代码错在哪
Private Sub DataGrid1_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.UpdateCommand
DataGrid1.EditItemIndex = -1
Dim name1 As TextBox = e.Item.Cells(1).Controls(0)
mycom.Connection = con
con.Open()
myadp.SelectCommand = mycom
mycom.CommandType = CommandType.Text
mycom.CommandText = "update contact set name='" + name1.Text.ToString() + "'"
mycom.ExecuteNonQuery()
con.Close()
End Sub
红色的那句好象不对,应该怎么改,运行时候说“无效的类型转换”