Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I loaded my data in dataset first time it load i must load only 20 records after timer should enable then after 10 sec i need load from 21 , like wise .

What I have tried:

C#
SqlDataAdapter dap = new SqlDataAdapter(@" select lat, lon ,ICAOCode,country,Stationname from  AVI_ICAOCodeList where country ='India'", scn);
            DataSet ds = new DataSet();
            dap.Fill(ds, "AVI_ICAOCodeList");
            for (int i = 0; i < ds.Tables["AVI_ICAOCodeList"].Rows.Count; i++)
            {


                if (i == 2)
                {
                    Timer1.Enabled = true;
                    break;
 
                }

}
Posted
Updated 7-Mar-16 5:18am
v3
Comments
John C Rayan 7-Mar-16 9:32am    
is it a internet application ? The timer should be in the client side and the request has to come from timer in client.

1 solution

use time control in your application
set the interval of timer to 2000
load the data on timer.tick event.
 
Share this answer
 
Comments
Member 12119075 7-Mar-16 23:45pm    
you ask me work like his

protected void Timer1_Tick(object sender, EventArgs e)
{


data();
}
Kashif-Sohail 8-Mar-16 0:51am    
Yes, Exactly
Member 12119075 8-Mar-16 1:20am    
Thank u its working fine , i need to display every time 10 records only i need to go up to 100.

for (i = j; i < ds.Tables["AVI_ICAOCodeList"].Rows.Count; i++)
{
j = j + 1;

Session["iterat"] = i + 1;
if (i == 10)
{

Timer1.Enabled = true;

break;

}

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900