c# - Not able to Delete a Entries from Database in mvc4 -


i trying delete record database specific row m not able it.

this linq query delete it

 formsubmit formsubmit = db.formsubmits.find(id);                 db.formsubmits.remove(formsubmit);                 db.savechanges(); 

and getting error this

enter image description here

i know because of foreign key how solve it.in sql use no check not getting in linq query.

not expert on this, this seems solution in case:

specify updatecheck = updatecheck.never on column in entity. disable update check , fix issue.

another option set cascade deletion on table in database.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -