Dim conn As New SqlConnection
conn.ConnectionString = ConfigurationManager.ConnectionStrings("ClinicConn").ConnectionString
Dim sql As String = "UPDATE Patients_tab SET Waiting=@Waiting WHERE ID=@ID"
conn.Open()
Dim btn As SqlCommand = New SqlCommand(sql, conn)
btn.Parameters.Add("ID", SqlDbType.Int)
btn.Parameters("@ID").Value = ID
btn.Parameters.AddWithValue("Waiting", "0")
btn.ExecuteScalar()
conn.Close()
GridView1.DataBind()
GridView2.DataBind()
尝试在自定义按钮中添加此代码,将“ Waiting” col的值从“ 1”更改为“ 0”,并将行从DG1更改为DG2,我得到了此错误
此ParameterParameterCollection不包含带有ParameterName'@ID'的SqlParameter