Server Error in '/' Application.
Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.
Possible Problem:
You placed a ReadOnlyAttribute in you entity key's metadata, which causes its value to become zero
[DisplayName("Student ID")]
[ReadOnly(true)]
public int StudentID { get; set; }
Solution:
Remove the ReadOnlyAttribute
[DisplayName("Student ID")]
public int StudentID { get; set; }
For other possible causes for this problem and possible solutions, please refer to this link http://stackoverflow.com/questions/1836173/entity-framework-store-update-insert-or-delete-statement-affected-an-unexpec
Visit Vitabase for Quality Health Supplements