我試圖根據cookie中的值將詳細信息插入表中。這裏是代碼插入帶有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子句,在那裏將值插入到某個行中添加行匹配一個cookie。我不知道正確的語法 感謝您的幫助
感謝您的幫助夥伴 – user3542214 2014-09-04 13:40:09