Part 11- Insert data into database in ASP.NET MVC | Submit a Form and Save Record | HD Video



Part 11- Insert data into database in ASP.NET MVC | Submit a Form and Save Record | HD Video

Part 11- Insert data into database in ASP.NET MVC | Submit a Form and Save Record | HD Video

In this video you will be able to insert your data in database using Entity framework. This is part 11 of the video series .Please watch part 10 of the video series because in that tutorial I have just created a form using html helper .Submitting a form and saving record is very simple in asp.net mvc application. Use following step to insert data in database .

CONTACT US: [email protected]

SOCIAL :

Like TechnoTips official Page : http://facebook.com/technotipstutorial
Subscribe : http://youtube.com/user/aapkanigam

GET CODE here :
http://technotipstutorial.blogspot.com/2016/11/part-11-insert-data-into-database-in-as.html

INTRODUCTION :
Please follow the steps :

Step 1 : Use html.BeginForm and pass the method name ,controller name and form type .
Step 2: Put all elements inside html begin form .

Step 3: At Test controller create a method Save Record and pass EmployeeViewModel class as parameter.

Step 4 : When you submit a form then control goes to your given method name in html BeginForm ,so you can get all element data at that method parameter.

Step 5 : Create object of Employee class and and add properties value equals to the parameter properties value

Step 6 : Finally add this class to db context and call savechanges method .

Step 7 : you can get the latest id of employee .

So in this way you can insert data in database .Here we submit a form and save record in database using Entity framework.

RECOMMENDATION

I strongly suggest you to watch these videos in order to consolidate your knowledge .

Watch MODEL VIEW ,CONTROLLER and DATABASE Connection Video :
1. MODEL : Part 4- https://www.youtube.com/watch?v=yeUDYcvPF3A
2. VIEW :Part 3- https://www.youtube.com/watch?v=Pt2UoRFuT-Y
3. CONTROLLER :Part 2- https://www.youtube.com/watch?v=g2GbL4hPOMg
4.Database connection : Part 6 :https://www.youtube.com/watch?v=UrHKfCCncHQ

TAGS :
how to create a – website
asp. net mvc
asp.net mvc interview questions
asp .net mvc tutorial
asp. net mvc 4
asp.net mvc 5 tutorial
asp net mvc developer
asp net mvc continuous integration
asp net mvc hosting
model view controller
jquery-ajax
$ ajax jquery
jquery ajax tutorial
viewbag
$controller
$model
razor view engine
$how to get rich

Comments are closed.