For updating record in Entity framework I am trying that. I am just assigning primary key CompanyID and The name of Company CompanyName to company because I need to change company name only. Record is not updating.
using (var myentity= new MyEntities())
{
myentity.AttachTo("Companies", company);
myentity.SaveChanges();
}
I think you need to first attach it and only after that set the company name.
Something like this: