Problem using sleep function
-
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()
-
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()
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
-
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
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).