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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaganathan BantheswaranPosted Dec 23, 2013, 3:44 AM
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
csharp beginnerPosted Dec 29, 2013, 12:27 AM
csharp beginnerPosted Dec 29, 2013, 12:20 AM
Jignesh TrivediPosted Dec 23, 2013, 3:13 AM
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.