Click here to Skip to main content
13,254,154 members (61,339 online)
Rate this:
 
Please Sign up or sign in to vote.
How to pass already stored data in the database each time the website is run in ASP.net MVC??
I have a controller with methods, i want it to be executed for the already stored data each time i run the application.

What I have tried:

Also is there any way to change in such a way that this stored data get passed into the controller in a timely manner. Say i want this stored data to be passed into the methods in controller every five minutes once.
Posted 14-Nov-17 11:59am
Updated 14-Nov-17 17:42pm
v2

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

How to pass already stored data in the database each time the website is run in ASP.net MVC??

use
ADO.NET[^] (or)
LINQ to SQL | Microsoft Docs[^] (or)
How to pass already stored data in the database each time the website is run in ASP.NET MVC?[^]
refer this example, Asp.Net MVC Get (Display) Data from Database using ADO.NET [^]

i want it to be executed for the already stored data each time i run the application.

Add your code in the starting page of the application eg (Home Controller, Index Action)

Also is there any way to change in such a way that this stored data get passed into the controller in a timely manner. Say i want this stored data to be passed into the methods in controller every five minutes once

However the action will be triggered from the view page, so you shall hit the controller for every 5 minutes using Ajax Call[^] and Window setInterval() Method[^] and get the latest data from the db using anyone of the above methods.
  Permalink  
Comments
Muthu Raman 15-Nov-17 13:00pm
   
Hello Karthik, I am using LiteDB and i dont think ADO.Net is an option. I am already using it in Index.
I run the application now and i store few data elements using created and all the methods work on it. This happens only on that run.
Next time i run the webapp i want the already stored data from last run to be pass through the methods before i add anything new.
Karthik Bangalore 5 days ago
   
Muthu Raman,
ok what ever might be the db, you shall store and retrieve the information rite.
store the last run information in some table and use it as reference and use it across on the future requests

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web03 | 2.8.171114.1 | Last Updated 14 Nov 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100