1
Answer

How can i select specific records from database in asp MVC?

Amit Kumar

Amit Kumar

7y
179
1
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.
  1. public ActionResult Solution(int ID)  
  2. {  
  3. Answers ans_obj = new Answers();  
  4. List<Ans_Table> dbobj= db.Ans_Table.ToList();  
  5. List<Answers> ansobj = dbobj.Select(x => new Answers  
  6. {  
  7. Answer = x.Answer,  
  8. Q_ID=x.Q_ID,  
  9. U_ID=x.U_ID  
  10. }).ToList();  
  11. return View();  
  12. }
Answers (1)
0
Pramod Thakur

Pramod Thakur

NA 7.3k 790.9k 7y
You can clear your browser cache manually or write a code for it. I am using jquery for it.
  
  1. $('.button').click(function() {  
  2.     $.ajax({  
  3.         url: "",  
  4.         context: document.body,  
  5.         success: function(s,x){  
  6.   
  7.             $('html[manifest=saveappoffline.appcache]').attr('content''');  
  8.                 $(this).html(s);  
  9.         }  
  10.     });   
  11. });  
 
 
0
Nilesh Shah

Nilesh Shah

NA 22.3k 214.4k 7y
mostly the proxy server caches the content of web pages,it's not your browser
 
if you check outside your organization it will be working.