PDA

View Full Version : مشکل در موقع Attach کردن و یا ApplyCurrentValues در هنگام ویرایش اطلاعات ؟!!!



elham_s20
دوشنبه 09 تیر 1393, 23:51 عصر
وقتی می خوام ازلاعات رو اپدیت کنم روی این کد
ctx.Factors.Attach(facedit);
این ارور رو میده
An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the same key.

واسه حل مشکل از
ctx.Factors.ApplyCurrentValues(facedit);
استفاده کردم اما اینجا هم این ارور رو میده
An object with a key that matches the key of the supplied object could not be found in the ObjectStateManager. Verify that the key values of the supplied object match the key values of the object to which changes must be applied.