TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Amit Kumar
NA
57
1.4k
How can i select specific records from database in asp MVC?
Nov 6 2017 8:22 AM
In the following code, I want to retrieve all those records whose Q_ID equals to the ID.
Currently, I Select whole records instead of few.
Please help me to solve this problem.
public
ActionResult Solution(
int
ID)
{
Answers ans_obj =
new
Answers();
List<Ans_Table> dbobj= db.Ans_Table.ToList();
List<Answers> ansobj = dbobj.Select(x =>
new
Answers
{
Answer = x.Answer,
Q_ID=x.Q_ID,
U_ID=x.U_ID
}).ToList();
return
View();
}
Reply
Answers (
1
)
how to filter items from a selected dropdown list
How to bind pages without reloading the menus in layout page