我正在使用VS 2010,MS SQL Server 2008,WPF 4
PalQuotationDataContext _palQuotationDataContext = new PalQuotationDataContext();
public void UpdateItemInformation(EItemInformation anItemInformation)
{
var itemInformation = _palQuotationDataContext.ITEMs.Single(item =>
item.IM_ID == anItemInformation.Id);
itemInformation.IM_NAME = anItemInformation.Name;
itemInformation.IM_DESCRIPTION = anItemInformation.Description;
itemInformation.IM_BRAND = anItemInformation.Brand;
itemInformation.IM_ORIGIN = anItemInformation.Origin;
itemInformation.IM_ACESS_BY = anItemInformation.AccessBy;
_palQuotationDataContext.SubmitChanges();
}
答案 0 :(得分:2)
您的表格需要primary key
。