錯誤,我有一個問題,如果你願意幫助我,我有一個錯誤問題在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
也許你的代碼是錯誤的。 –
可能就是你拼錯的細節。 –