Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi Guys!
Combobox in ASP.NET MVC4 without Entity Framework,Can anyone tell me how to use combobox for sending or retrieving data into database?
I have a table of Student and Class. when i am creating the student then here Class_Id of ClassTable should be show in combobox.When I select the Classid then the students of selected classid should be show from database.
When i want to show the data of Student,then the Student_Id of student table should be show in combobox.The data of selected Student_Id should be show.By using ASP.NET MVC4 only.
please help me or if anyone have any example about sending or retreiving data to database through combobox then comment.

What I have tried:

I tried to send the data of selected id in combobox to database but not worked properly.
How to do please help me
Posted
Updated 5-Dec-16 19:11pm
v2
Comments
Ehsan Sajjad 5-Dec-16 11:53am    
you need to show how your tried code looks like.

MVC is a presentation framework, it has no way of accessing databases itself so you can't add data to a database using MVC only, you're going to have to use some kind of database framework. If you don't want to use Entity Framework then use ado.net. Google "getting started with ado.net" for examples of basic functions, or "ado.net crud" so see examples of creating, reading, updating and deleting data.
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900