insert update delete in MVC 4 using entity framework

Unknown
1

 Implementation: Let's create our first Asp.Net MVC web application.


  • Open Visual Studio -> File -> New -> Project
  • Select you preferred language either Visual C# or Visual Basic. For this tutorial we will use Visual C#.
  • Name the project "MvcApplication9". Specify the location where you want to save this project as shown in image below. Click on Ok button. 

  •  
     
  • Select Internet Application


 

    •  It will add the required files and folder automatically as shown in image below.
      
    • You can run the application using F5 or from the Debug menu of Visual Studio select Start Debugging. You will see the page as shown below:
       

    Creating Model

    •   Right Click on the Models folder of the project -> Add -> Class as shown in image below 

    Name the class "MyMovieClass.cs"

             MyMovieClass.cs
    Creating Controller
    • Right click on the Controller folder -> Add -> Controller as shown below.

     
      
        Name the controller : "MoviedetailsController".
        Template: MVC Controller with read/write actions and views, using Entity Framework.
         Model class: MyMovieClass(MvcApplication9.Models)
         Data context class: MovieDetails(MvcApplication9.Models)
           Views: Razor (CSHTML). 
    •  Congrats you have created the MVC application having Create, Read, Update and Delete (CRUD) functionality.

    • Run the application using F5
    • browser: http://localhost:4894/moviedetails/.
    You will see the page as shown in image below:
    Clicking on "Create New" Button will open the screen as shown in image below.

     Add the details and save some records e.g. as shown in image below:

    Clicking on "Details" button you can view the details of any particular record




     
     
    You can also edit any particular record click edit button...
     
      You can also delete any particular delete record so click delete button..

    You can add mulitple record and show in below image.



    Notes you:
    " I hope you have created your Asp.Net MVC application successfully and If you like my work; you can appreciate by leaving your comments and updates".
    https://drive.google.com/file/d/0B2IApSbYmMGZTEQyNkliekUxQmM/view 
    Tags:

    Post a Comment

    1Comments

    Post a Comment