Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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
[Key]
        public int UserId { get; set; }
 public User SaveUser(User user)
        {
            try
            {
                if (user.UserId == 0)
                {
                    //Added by Narasimha
                    var UserId = objSequenceHelper.GetNextValue(DomainModels.Enumerations.Sequences.S_SECURITY_USER);
                    //StoreGeneratedPattern.Identity.ToString();
                    user.UserId = UserId;
                    db.Users.Add(user);
                }
                else
                    db.Entry(user).State = System.Data.EntityState.Modified;
                db.SaveChanges();
                return user;
            }
}


while saving geting above error .

Thanks & regards,
Narasimha
Posted
Updated 3-Jul-13 23:47pm
v2
Comments
Uday P.Singh 4-Jul-13 5:41am    
what is the inner exception?
Orcun Iyigun 4-Jul-13 6:34am    
As the exception thrown: See the inner exception for details. Have you seen it??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900