错误,我有一个问题,如果你愿意帮助我,我有一个错误问题在asp.net C#
必须声明标量变量 “@Deitails”。
,我找不出什么问题,因为我不知道标量是关于什么的
var sqlCon = new
SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
// GET CONFERENCE ROLE ID
SqlCommand cmd = new SqlCommand();
cmd.Connection = sqlCon;
cmd.CommandText = "select Conference_Role_ID from AuthorPaper
where Paper_ID = @PaperId";
cmd.Parameters.AddWithValue("@PaperId",
paperId);
cmd.Connection.Open();
string ConferenceRoleId = cmd.ExecuteScalar().ToString();
cmd.Connection.Close();
cmd.Dispose();
string query2 = @"insert into
ReviewPaper(Overall_Rating,Paper_id,Conference_role_id,Deitails)
values(0,@paperId,@ConferenceRoleId,@Deitails);select
SCOPE_IDENTITY() as RPID";
cmd = new SqlCommand(query2, sqlCon);
cmd.Parameters.AddWithValue("@paperId",
paperId);
cmd.Parameters.AddWithValue("@ConferenceRoleId",
ConferenceRoleId);
string ReviewPaperId;
try
{
cmd.Connection.Open();
ReviewPaperId = cmd.ExecuteScalar().ToString();
cmd.Connection.Close();
}
catch (Exception ee) { throw ee; }
finally { cmd.Dispose(); }
感谢
您需要提供更多信息。请张贴一些代码。 – PHeiberg
也许你的代码是错误的。 –
可能就是你拼错的细节。 –