-1
當我插入在表中的數據是給我錯誤解析查詢時發生錯誤。 [令牌行號= 1,令牌行偏移= 59,令牌在錯誤=用法]
public int SolveSection(string sectionName, string userid, string examId, string TotalSolveQuestion, string time)
{
SqlCeCommand cmd = new SqlCeCommand();
int a = 0;
Random rnd = new Random();
_connection.Open();
cmd.Parameters.Add(new SqlCeParameter("@User_id", userid));
cmd.Parameters.Add(new SqlCeParameter("@Exame_id", examId));
cmd.Parameters.Add(new SqlCeParameter("@Interactive usage of English_Solve_Total_qouation", TotalSolveQuestion));
cmd.Parameters.Add(new SqlCeParameter("@Interactive usage of EnglishT", time));
cmd.Parameters.Add(new SqlCeParameter("@Interactive usage of English", sectionName));
cmd.Connection = _connection;
//cmd.CommandText = "Insert into [Personal_information_ofcandidat](User_id,Name,MName,LName,Exam_date,Exam_id,College_Name,Email_id,Phone_no) values('" + userid + "','" + uname + "','" + muname + "','" + luname + "','" + DateTime.Now + "','" + examid + "','" + collegname + "','" + email + "','" + mobile + "')";
cmd.CommandText = "Insert into [Solve_Question](user_id,Exame_id,Interactive usage of English_Solve_Total_qouation,Interactive usage of EnglishT,Interactive usage of English)" + "values(@User_id,@Exame_id,@Interactive usage of English_Solve_Total_qouation,@Interactive usage of EnglishT,@Interactive usage of English)";
cmd.CommandType = CommandType.Text;
try
{
a = cmd.ExecuteNonQuery();
if (a > 0)
{
}
else { userid = ""; }
_connection.Dispose();
}
catch (Exception ee) { }
return a;
}
它給我一個錯誤消息:
分析查詢時發生錯誤。 [令牌行號= 1,令牌行偏移= 59,令牌出錯=使用] 在行ExecuteNonQuery()行。我錯在哪裏。
[帶空格的列] –