I want to show last 1 hour data from the database on the graph.
I am not getting any idea, please help, how should i do this?
Regards
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Dec 22, 2013, 10:44 PM EST
You can achieve this using Timer.
var timer = new System.Timers.Timer(1000);
int lastHour = DateTime.Now.Hour;
timer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{
if(lastHour < DateTime.Now.Hour || (lastHour == 23 && DateTime.Now.Hour == 0))
{
lastHour = DateTime.Now.Hour;
YourMethodToGetData();
}
}
In SQL,
select the data updated/created within an hour.
SELECT column_name(s)
FROM table_name
WHERE column_name
BETWEEN timenow-1 AND timenow
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 22, 2013, 10:13 PM EST
Are you develop web application on window base application..
both have chart control with the help of chart control you can show the record...
generally this chart control takes datatable or any other collection as a datasource.
so get the data using either command or data adapter and fill data set, assign to control
hope this will help you.
csharp beginner38 reputationPosted Dec 28, 2013, 7:20 PM EST
csharp beginner38 reputationPosted Dec 28, 2013, 7:27 PM EST