Tuesday, August 18, 2015

Insert, Update and Delete Data in MVC5 Using Entity Framework

Insert, Update and Delete Data in MVC5 Using Entity Framework


Create new database and table like below


Continue with article: http://www.microsofttechnology.net/2015/08/how-to-create-mvc-5.html, open that project - right click to models folder >> Add new item >> from left panel choose Data >> Ado.NET Entity Data Model


Click new connection ... button >> choose data source is Microsoft SQL Server >> Continue


Server name: input . or (local) >> select existing database


Choose Entity Framework 5.0 >> Next


Choose your table


After create Model then create Controller >> Right click to controller folder >> Add >> Controller >> choose MVC 5 ... like image below


Choose model class and Data context. 


Here is default view


Try to run project F5, here is list of item


Here is Create View


Here is Edit view


Here is detail view


Done.
This is way we implement action base on default. we can implement it by custom. i will create it at the next time.

0 comments:

Post a Comment