日期:2014-05-20 浏览次数:20915 次
protected void update(mytable mytable)
{
Entities db = new Entities();
mytable mytable1 = (from p in db.mytables where p.UserID == mytable.UserID select p).FirstOrDefault();
mytable1 = mytable;
db.SaveChanges();
db.Dispose();
}
var query = db.PARA_COMPANYS.Where(p => p.ID == intid);
var target = query.FirstOrDefault<PARA_COMPANYS>();
target.COMPANY_CODE = COMPANY_CODE_tb.Text;
target.COMPANY_NAME = COMPANY_NAME_tb.Text;//后面可继续添加需要更改列
db.SaveChanges();//更新数据