hi,
I have a datagrid view i nee to refresh it in every 2 seconds, how do i do it?
TY
How do i refresh my dataset?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 7, 2009, 5:31 PM EDT
private void timer1_Tick(object sender, EventArgs e)
{
//Code For Filling Data GridView from Database
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Enabled = true;
timer1.Interval = 2000;
}
Roei BarRank #1,271 · 1.4K reputationPosted Oct 7, 2009, 10:00 PM EDT
also make sure that when you arrive to the timer like Kirtan showed, you first set the timer.Enabled = false
and 2 the end of the block you reset it to timer.Enabled = true
Amit ChoudharyRank #145 · 15.8K reputationPosted Oct 8, 2009, 9:48 PM EDT
and Refresh it by sending the ajax request in javascript's
window.setTimeOut('2000');
function.