Skip to content

How to update a table every one minute in c#

omar ahmed

Asked Dec 12, 2008, 9:50 AM EST3 answers
Share
LinkedInX

Hi all,

 its my firts post in this great forum

 I am developing a simple application that will be used for a net cafe

I have 5 tables for 5 PCs  in one database (called NetDB.mdb)

what I need to do is to update the table of each PC account into   the database every 1 minute  so that if there  is failure in power every thing is kept inside the table .

second can I display the last row of each table in a gridview so I can see the accounts of all the PCs at one time , How can I program this

thanx in adnavce

I would appreciate to receive help  

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Bechir Bejaoui
    0
    I it worth that you create a windows service that you suscribe in the statring list start>all program>start list so it starts automatically when windows starts  and you can use the Timer object to fire off an asynchronous calls for a period that you can precize

     Timer tm = new Timer(new TimerCallback(TimerTick), null, 0, 60000);

    public static void TimerTick(object state)
            {
               /* TO DO leverage the code here to update your
                * data base*/
            }

    To get the last row of  a data table


    datatable.rows(datatable.rows.count -1);
    0
  • 0

    Hi, Thank u for the reply

    I am gonna try it .

    0
  • 1 short reply
    • Bechir Bejaoui
      0
      Ok
      0