我尝试传递参数pdata,需要从文本框中获取varchar并获取错误:
Method not found: 'Void System.Data.SqlClient.SqlParameterCollection.Rollback(System.String)'.
继承我的代码:
Protected Sub changeNum_Click(sender As Object, e As EventArgs) Handles changeNum.Click
Dim retValue As Integer
Dim connection As SqlConnection
connection = New SqlConnection("Data Source=151-rsS\SQLEXPRESS;Initial Catalog=easyDb;Integrated Security=SSPI; ")
Dim Command = New SqlCommand("UPDATE mytable Set pdata = @value1", connection)
Command.Parameters.AddwithValue("@value1", htgtextbox.Text)
connection.Open()
retValue = Command.ExecuteNonQuery()
connection.Close()
End Sub