title: An object that has a key that matches the key of the supplied object could not be found in the ObjectStateManager
body: <p>I Use following code</p>
  
  <pre><code>Tel_CallHistory CallHistory = new Tel_CallHistory();
  
  
                       CallHistory.MobileNo = MobileNo;
                       CallHistory.CRId = CallResponse;
                       CallHistory.CallRemark = CallRemark;
                       CallHistory.UserId = UserId;
                       CallHistory.CallDate = DateTime.Now;
                       CallHistory.CallTime = DateTime.Now.TimeOfDay;
  
                       CallHistory.MeetingPoint = meetingpoint;
                       if (CallResponse == 1)
                       {
                           CallHistory.NCallDateOn = null;
                           CallHistory.NCallTimeAt = null;
                           CallHistory.MeetingDate = Convert.ToDateTime( meetingdate);
  
                           CallHistory.MeetingTime =  DateTime.Parse(meetingtime).TimeOfDay;
                       }
                       else
                       {
  
                           CallHistory.NCallDateOn =  Convert.ToDateTime(NCallDateOn);
  
                           CallHistory.NCallTimeAt =  DateTime.Parse(NCallTimeAt).TimeOfDay;  
  
                           CallHistory.MeetingDate = null;
                           CallHistory.MeetingTime = null;
                       }
  
  
                       db.Tel_CallHistory.AddObject(CallHistory);
  
  
                       Tel_Mobile TelMobile = _teacher.getDB().Tel_Mobile.Single(a =&gt; a.MobileNo == MobileNo);
                       TelMobile.CallDate = CallHistory.NCallDateOn;
                       TelMobile.CallTime = CallHistory.NCallTimeAt;
  
                       TelMobile.LCallDateOn = CallHistory.CallDate;
                       TelMobile.LCallTimeAt = CallHistory.CallTime;
                       TelMobile.LCRId = CallHistory.CRId;
                       TelMobile.LCallRemark = CallHistory.CallRemark;
                       TelMobile.LMeetingPoint = CallHistory.MeetingPoint;
                       TelMobile.LMeetingDate = CallHistory.MeetingDate;
                       TelMobile.LMeetingTime = CallHistory.MeetingTime;
  
                        db.Tel_Mobile.ApplyOriginalValues(TelMobile);
  
  
                       db.SaveChanges();
  
  
  
                       db.AcceptAllChanges();
  </code></pre>
  
  <p>but when <code>db.Tel_Mobile.ApplyOriginalValues(TelMobile)</code> executes, show error </p>
  
  <blockquote>
    <p>An object that has a key that matches the key of the supplied object
    could not be found in the ObjectStateManager. Verify that the object
    to which changes must be applied is not in the Added state and that
    its key values match the key values of the supplied object.</p>
  </blockquote>