Top Categories
Part 13 - Insert data into MULTIPLE TABLES in an ASP.NET MVC application
- Category: Information Technology
- Sub Category: Web Development
In this video you will be able to insert your data into multiple table of database using Entity framework.
CONTACT US: technotipstutorial@gmail.com
SOCIAL :
Like TechnoTips official Page : http://facebook.com/technotipstutorial
Subscribe : http://youtube.com/user/aapkanigam
Get CODE HERE:
http
In this video you will be able to insert your data into multiple table of database using Entity framework.
CONTACT US: technotipstutorial@gmail.com
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-13-insert-data-into-multiple-table.html
INTRODUCTION :
This is part 13 of the video series .Please watch part 11 and 12 of the video series because in that tutorial I have just created a form using html helper .
Submitting a form and saving record in multiple table is very simple in asp.net mvc application. Use following step to insert data in database .
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 overload method Index 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 from the parameter
Step 6 : Finally add this class to db context and call savechanges method .
Step 7 : you can get the latest id of emplyee .
Step 5 : Create object of Site class and and add properties value from the parameter properties value and latestEmpId
So in this way you can insert data into multiple table of database .
RECOMMENDATION:
Watch MODEL VIEW,CONTROLLER and bootstrap here
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.Bootstrap PopUp modal : https://www.youtube.com/watch?v=hKulrfOP_HI
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 Post
$ ajax jquery
jquery ajax tutorial
viewbag
$controller
$model
Part 13 - Insert data into multiple table in an Asp.net MVC application
Part 13 - Insert data into multiple table in an Asp.net MVC application