我有我的SQL Server CE数据库的插入工作正常,但我很努力地更新。试图更新SQL Server CE失败
有人能看到什么错什么,我想
using (SqlCeConnection con = new SqlCeConnection(ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString))
{
con.Open();
// Insert into the SqlCe table. ExecuteNonQuery is best for inserts.
string sql = "UPDATE SalesAssistant SET "
+ "([email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected])" +
"WHERE [email protected]";
using (SqlCeCommand com = new SqlCeCommand(sql, con))
{
com.Parameters.AddWithValue("@SalesAssistantID", em.ServerData.EmployeeID);
com.Parameters.AddWithValue("@Name", em.ServerData.EmployeeName);
com.Parameters.AddWithValue("@IsEnabled", em.ServerData.IsEnabled);
com.Parameters.AddWithValue("@LastModifiedDate", em.ServerData.LastModifiedDate);
com.Parameters.AddWithValue("@IsAdministrator", em.ServerData.IsAdministrator);
com.Parameters.AddWithValue("@IsDeleted", em.ServerData.IsDeleted);
com.Parameters.AddWithValue("@Role", em.ServerData.Role);
com.Parameters.AddWithValue("@PIN", em.ServerData.PIN);
com.ExecuteNonQuery();
}
}
我收到以下错误:
There was an error parsing the query. [ Token line number = 1,Token line offset = 27,Token in error = (]
而开始投票选择有用的答案。 – 2010-10-23 05:06:36