ASP.net MVC 4.0: CRUD Opreation in SQL server compact addtion through ADO.net Entity Data Model

1. Add New MVC Project

mvc1

 

2. Select template Internet Application. 

mvc2

 

3. Add database in App_Data folder

mvc3

 

4. Create table in your database

mvc4

 

5. Add New Item select ADO.NET Entity Data Model

mvc5

 

Complete Entity data model wizard

mvc6

 

6. First Run the application then Add Controller

In Scaffolding option

Select template->MVC controller with read/write actions and views, using Entity Framework

Select Model class-> This is the name of your database table name.

Select Data context class->This is the name of your Database name Entities

mvc7

7. Add new menu  Goto Views->Shared->Layout.cshtml

mvc12

 

8. Insert your Primary key field Goto Views->Default1->Index.cshtml & Details.cshtml

mvc13

9. Run The Application & Select Employee in menu

mvc14

 

10. Create New

mvc15

 

11. Enter data in field & click create button

mvc9

mvc8

You can view Details, Edit, Delete records……

12. Check your database

mvc10