쿠키의 값에 따라 테이블에 세부 정보를 삽입하려고합니다. 여기에 코드where 절을 사용하여 문을 삽입하십시오. C#
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString);
conn.Open();
string insertQuery = "insert into Details (Employees, Performance, TotalPerformance, Attitude, TotalAttitude) values(@employees, @performance ,@totalPerformance, attitude, totalAttitude)";
SqlCommand com = new SqlCommand(insertQuery, conn);
com.Parameters.AddWithValue("@employees", Request.QueryString["employees"]);
com.Parameters.AddWithValue("@performance", totalPer.ToString());
com.Parameters.AddWithValue("@totalPerformance", totalPercent.ToString());
com.Parameters.AddWithValue("@attitude", totalAtt.ToString());
com.Parameters.AddWithValue("@totalattitude", totalPercent.ToString());
com.ExecuteNonQuery();
이 잘 작동하지만 열 "이름"의 값에 말했다 경우 문자열 삽입 쿼리 라인에서 내가 특정 행에 값을 삽입하는 where 절에 추가 할 수있다 행은 쿠키와 일치합니다. 적절한 구문을 모르겠습니다. 도움을 주셔서 감사합니다.
도움 주셔서 감사합니다 – user3542214