当执行
cmd.ExecuteNonQuery()
时,我遇到了一个错误,提示“必须声明标量变量:”。OleDbCommand cmd = new OleDbCommand();
cmd.Connection = Connection;
cmd.CommandTimeout = 0;
string commandText = "update groups set subjectline ='" + txtSubjectLine.Text + "',data= @data where groupid = " + ddlGroup.SelectedItem.Value + " ";
cmd.CommandText = commandText;
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add("@Data",OleDbType.VarBinary);
cmd.Parameters["@Data"].Value = binarydata;
cmd.ExecuteNonQuery();