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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problem using sleep function

Problem using sleep function

Scheduled Pinned Locked Moved ASP.NET
databasehelpquestion
3 Posts 2 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.
  • S Offline
    S Offline
    solarthur01
    wrote on last edited by
    #1

    The below code is meant to get data from a db, display the first row, sleep for 2 seconds then display the second row. Can anyone spot what i may have done wron??? many thanks. Dim ds As DataSet = New DataSet ad.Fill(ds, "tblcustomers") Dim dtab As DataTable = ds.Tables(0) Dim dtabclone As DataTable = dtab.Clone() Dim drow As DataRow = dtab.Rows(0) dtabclone.ImportRow(drow) GridView1.DataSource = dtabclone GridView1.DataBind() 'gridview1 System.Threading.Thread.Sleep(2000) drow = dtab.Rows(1) dtabclone.ImportRow(drow) GridView1.DataSource = dtab.Clone GridView1.DataBind()

    V 1 Reply Last reply
    0
    • S solarthur01

      The below code is meant to get data from a db, display the first row, sleep for 2 seconds then display the second row. Can anyone spot what i may have done wron??? many thanks. Dim ds As DataSet = New DataSet ad.Fill(ds, "tblcustomers") Dim dtab As DataTable = ds.Tables(0) Dim dtabclone As DataTable = dtab.Clone() Dim drow As DataRow = dtab.Rows(0) dtabclone.ImportRow(drow) GridView1.DataSource = dtabclone GridView1.DataBind() 'gridview1 System.Threading.Thread.Sleep(2000) drow = dtab.Rows(1) dtabclone.ImportRow(drow) GridView1.DataSource = dtab.Clone GridView1.DataBind()

      V Offline
      V Offline
      Venkatesh Mookkan
      wrote on last edited by
      #2

      solarthur01 wrote:

      The below code is meant to get data from a db, display the first row, sleep for 2 seconds then display the second row. Can anyone spot what i may have done wron???

      Your are confused & you are not aware of what you are doing. The code (I am not sure how it works) executes in the Server-side, and the final result would be the output of

      solarthur01 wrote:

      Dim ds As DataSet = New DataSet ad.Fill(ds, "tblcustomers") Dim dtab As DataTable = ds.Tables(0) Dim dtabclone As DataTable = dtab.Clone() Dim drow As DataRow = dtab.Rows(0) dtabclone.ImportRow(drow) GridView1.DataSource = dtabclone GridView1.DataBind() 'gridview1 System.Threading.Thread.Sleep(2000) drow = dtab.Rows(1) dtabclone.ImportRow(drow) GridView1.DataSource = dtab.Clone GridView1.DataBind()

      I think, you should try it with JavaScript + HTML Tables

      [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

      S 1 Reply Last reply
      0
      • V Venkatesh Mookkan

        solarthur01 wrote:

        The below code is meant to get data from a db, display the first row, sleep for 2 seconds then display the second row. Can anyone spot what i may have done wron???

        Your are confused & you are not aware of what you are doing. The code (I am not sure how it works) executes in the Server-side, and the final result would be the output of

        solarthur01 wrote:

        Dim ds As DataSet = New DataSet ad.Fill(ds, "tblcustomers") Dim dtab As DataTable = ds.Tables(0) Dim dtabclone As DataTable = dtab.Clone() Dim drow As DataRow = dtab.Rows(0) dtabclone.ImportRow(drow) GridView1.DataSource = dtabclone GridView1.DataBind() 'gridview1 System.Threading.Thread.Sleep(2000) drow = dtab.Rows(1) dtabclone.ImportRow(drow) GridView1.DataSource = dtab.Clone GridView1.DataBind()

        I think, you should try it with JavaScript + HTML Tables

        [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

        S Offline
        S Offline
        solarthur01
        wrote on last edited by
        #3

        the above code works (partially). it only displays one record. It is meant to display one record sleep for 2 seconds, then display the next record(as the code specifies).

        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