Quantcast
Channel: .Net Core | MVC | HTML Agility Pack | SQL | Technology Crowds
Viewing all articles
Browse latest Browse all 544

Exception: System Data Entity Infrastructure DbUpdateException

$
0
0

Introduction

I was working on MVC application using Entity Framework, MVC, Jquery. I hit the Save button to save corresponding values into database, but this time did not go fine as usual, I got the given error An exception of type 'System.Data.Entity.Infrastructure.DbUpdateException' occurred in EntityFramework.dll but was not handled in user code.

Error Description

An exception of type 'System.Data.Entity.Infrastructure.DbUpdateException' occurred in EntityFramework.dll but was not handled in user code

Solution

When I started working to resolve issue, debugging deeply and came across of stack trace message then I found that this issue was due to database table identity off.

Table Identity off

I just set table Identity on and again tried to save relevant values into database, this time it worked fine for me.
Table Identity On

Conclusion

Another very good experience of MVC, Entity Framework, Jquery application. Every time, in every new application often comes new issues. From these issues, we learnt a new lesson every time and smoothing way to next time. Above, I have explained in detail how can we resolve issue of An exception of type 'System.Data.Entity.Infrastructure.DbUpdateException' occurred in EntityFramework.dll but was not handled in user code. If you still find the same issue, please don't forget to write me here.

Suggested Reading



Viewing all articles
Browse latest Browse all 544