P Narasimha

P Narasimha

  • 664
  • 1.2k
  • 244.1k

Ado.net entity frmawork error getting while saveChanges()

Jul 4 2013 5:56 AM
Hi All,

Please help me anybody on this.

I am getting below error while save data into database.

I am using Code firtst entity Framework.

error is this. error on Updating record "An error occurred while updating the entries. See the inner exception for details.

Model is 
        public int UserId { get; set; }
 public User SaveUser(User user)
                if (user.UserId == 0)
                    var UserId = objSequenceHelper.GetNextValue(DomainModels.Enumerations.Sequences.S_SECURITY_USER);
                    user.UserId = UserId;
                    db.Entry(user).State = System.Data.EntityState.Modified;
                return user;

while saving geting above error .

Answers (4)