以下是我用来更新客户表的示例代码。
public void UpdateCustomer(){
SAPDB db = new SAPDB();
SubSonicRepository<Customer> ssr = new SubSonicRepository<Customer>(db);
Customer customer = new Customer();
customer.ID = 5;
customer.CustomerName = "John";
int val = ssr.Update(customer);
}
请让我知道我跟随的方式是对还是错?或者在SubSonic 3中是错误的吗?
答案 0 :(得分:0)
你的架构是什么?
您可能希望通过
加载客户的现有数据Customer c= new Customer(5);
customer.CustomerName = "John";
customer.Save();