Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Timer Display data from database

Timer Display data from database

Scheduled Pinned Locked Moved C#
databasehelptutorialquestion
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jacklynn_mei
    wrote on last edited by
    #1

    Hello... Can some body help me with Timer? I want to display the data from my database. For an example: i) 1st data will be displayed ( 10 seconds) ii)After 10 seconds finish, 2nd data will be displayed iii) These data will be displayed continuously (looping) Please help me. Thanks in advance Jac

    A S K 3 Replies Last reply
    0
    • J jacklynn_mei

      Hello... Can some body help me with Timer? I want to display the data from my database. For an example: i) 1st data will be displayed ( 10 seconds) ii)After 10 seconds finish, 2nd data will be displayed iii) These data will be displayed continuously (looping) Please help me. Thanks in advance Jac

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      where do you and which way do you want show the data?:confused::confused: you can read the data at a time and simply use a timer to display on time:cool:

      Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"

      J 1 Reply Last reply
      0
      • A Abhijit Jana

        where do you and which way do you want show the data?:confused::confused: you can read the data at a time and simply use a timer to display on time:cool:

        Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"

        J Offline
        J Offline
        jacklynn_mei
        wrote on last edited by
        #3

        I have done something like the code below. It will display the data but, it won't display for 10 seconds it will read all the data from database then only the timer stop for 10 seconds. What i'm expected is, each data display at 10 seconds of time then only continue to the next data and so on... public load(....) { Timer myTimer = new Timer(); myTimer.Interval = 10000; myTimer.Enabled = true; myTimer.Tick += new EventHandler(Timer_Tick); } public void Timer_Tick(object sender, EventArgs e) { string conStrg; conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456"); SqlConnection connTimer = new SqlConnection(conStrg); connTimer.Open(); string selSQL = "Select txtDesc FROM txtScroll"; SqlCommand com = new SqlCommand(selSQL, connTimer); SqlDataReader reader = com.ExecuteReader(); DataSet ds = new DataSet(); while (reader.Read()) { alphaTxtMain.Text = " " + reader["txtDesc"]; myTimer.Interval = 10000; myTimer.Stop(); }

        N 1 Reply Last reply
        0
        • J jacklynn_mei

          Hello... Can some body help me with Timer? I want to display the data from my database. For an example: i) 1st data will be displayed ( 10 seconds) ii)After 10 seconds finish, 2nd data will be displayed iii) These data will be displayed continuously (looping) Please help me. Thanks in advance Jac

          S Offline
          S Offline
          sindhutiwari
          wrote on last edited by
          #4

          simple dude ........if u have a auto number or a counter in ur database then u can do it .................... step 1: start the timer in form load step 2: write a event ............ step 3: assign that event to timer srep 4: write a perfect query in event like "select * from tablename where counter = @counter"; step 5; add the parameter n assign it to a integer which will increement each time the event is triggered step 6 : last but not the least assign the output to a grid ........ important clear the grid each time

          its me sid

          J 1 Reply Last reply
          0
          • S sindhutiwari

            simple dude ........if u have a auto number or a counter in ur database then u can do it .................... step 1: start the timer in form load step 2: write a event ............ step 3: assign that event to timer srep 4: write a perfect query in event like "select * from tablename where counter = @counter"; step 5; add the parameter n assign it to a integer which will increement each time the event is triggered step 6 : last but not the least assign the output to a grid ........ important clear the grid each time

            its me sid

            J Offline
            J Offline
            jacklynn_mei
            wrote on last edited by
            #5

            Dude..have done like the code below but the data cannot display for 10secs. public load(....) { Timer myTimer = new Timer(); myTimer.Interval = 10000; myTimer.Enabled = true; myTimer.Tick += new EventHandler(Timer_Tick); } public void Timer_Tick(object sender, EventArgs e) { string conStrg; conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456"); SqlConnection connTimer = new SqlConnection(conStrg); connTimer.Open(); string selSQL = "Select txtDesc FROM txtScroll"; SqlCommand com = new SqlCommand(selSQL, connTimer); SqlDataReader reader = com.ExecuteReader(); DataSet ds = new DataSet(); while (reader.Read()) { alphaTxtMain.Text = " " + reader["txtDesc"]; myTimer.Interval = 10000; myTimer.Stop(); }

            S 1 Reply Last reply
            0
            • J jacklynn_mei

              Dude..have done like the code below but the data cannot display for 10secs. public load(....) { Timer myTimer = new Timer(); myTimer.Interval = 10000; myTimer.Enabled = true; myTimer.Tick += new EventHandler(Timer_Tick); } public void Timer_Tick(object sender, EventArgs e) { string conStrg; conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456"); SqlConnection connTimer = new SqlConnection(conStrg); connTimer.Open(); string selSQL = "Select txtDesc FROM txtScroll"; SqlCommand com = new SqlCommand(selSQL, connTimer); SqlDataReader reader = com.ExecuteReader(); DataSet ds = new DataSet(); while (reader.Read()) { alphaTxtMain.Text = " " + reader["txtDesc"]; myTimer.Interval = 10000; myTimer.Stop(); }

              S Offline
              S Offline
              sindhutiwari
              wrote on last edited by
              #6

              i dint get u...data is not at all displayed or its blinking...?

              its me sid

              J 1 Reply Last reply
              0
              • J jacklynn_mei

                Hello... Can some body help me with Timer? I want to display the data from my database. For an example: i) 1st data will be displayed ( 10 seconds) ii)After 10 seconds finish, 2nd data will be displayed iii) These data will be displayed continuously (looping) Please help me. Thanks in advance Jac

                K Offline
                K Offline
                KennyPatel
                wrote on last edited by
                #7

                Hi. You can use above meta tag which refresh every 5 seconds your page. U can use it in also. I hope can help this. Thanks :laugh: <div class="ForumSig">"Good Thing Goes With Good People..."</div></x-turndown>

                1 Reply Last reply
                0
                • J jacklynn_mei

                  I have done something like the code below. It will display the data but, it won't display for 10 seconds it will read all the data from database then only the timer stop for 10 seconds. What i'm expected is, each data display at 10 seconds of time then only continue to the next data and so on... public load(....) { Timer myTimer = new Timer(); myTimer.Interval = 10000; myTimer.Enabled = true; myTimer.Tick += new EventHandler(Timer_Tick); } public void Timer_Tick(object sender, EventArgs e) { string conStrg; conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456"); SqlConnection connTimer = new SqlConnection(conStrg); connTimer.Open(); string selSQL = "Select txtDesc FROM txtScroll"; SqlCommand com = new SqlCommand(selSQL, connTimer); SqlDataReader reader = com.ExecuteReader(); DataSet ds = new DataSet(); while (reader.Read()) { alphaTxtMain.Text = " " + reader["txtDesc"]; myTimer.Interval = 10000; myTimer.Stop(); }

                  N Offline
                  N Offline
                  NassosReyzidis
                  wrote on last edited by
                  #8

                  Hi Jacklynn, i see in your code the myTimer.Stop(); while reading from the db, where is the myTimer.Start();?? Nassos

                  GanDad

                  1 Reply Last reply
                  0
                  • S sindhutiwari

                    i dint get u...data is not at all displayed or its blinking...?

                    its me sid

                    J Offline
                    J Offline
                    jacklynn_mei
                    wrote on last edited by
                    #9

                    Mmm..it's like blinking. Supposed that, the output is 10secs for each data to be displayed.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups