In the first part, I was introduced you how to get the list student and show it on browser.
In this part, I will show you how to Insert the student into database.
III. Insert Student
1. Add View Create
Go to Folder Controllers => HomeController.cs
We choose Scaffold template : Create and Model class: StudentDTO => It will automatically create the form contain all fields of StudentDTO into the Label and TextBox
Now we run and take a look the result.
The ClassName is a textbox but I appreciate the dropdownlist contain the name and value.
2. Get List Class and Show it in the DropDownList
2.1/ Stored Procedure
2.2/ Retrieve the result from Stored Procedure – ClassDAO
2.3/ Declare the variable to store the result from ClassDAO – HomeController.cs
2.4/ Edit the View => Create.cshtml
3.1/ Stored Procedure
3.2/ Retrieve the result from Stored Procedure – StudentDAO
3.3/ Call the method InsertStudent from StudentDAO – HomeController.cs
Great work! Thanks for the excellent explanation.
Thanks for the tutorials can you please send me the source code through my mail osaewusu@gmail.com
Thanks for this great tutorial. Can you complete it by writing Edit and Delete as well please?