Go Back   Velocity Reviews > General Computer Discussion > Software
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
Old 12-23-2008, 02:18 AM   #1
Default loop according to the delay


hello

i have problem in looping according to the delay....the delay is coming from the ms access...the delay is 1s ,2s ,3s ,4s ,5s, 6 ....i attached my coding to this...i do this webpage in asp.net...plese help in this.....button_1 is start the looping....... btnstop is to stop the looping...Timer_1 is ajax uset to refresh automatically...for each row in the datagrid have delay..it must loop the datagrid according to that delay...thank u so much...i need this help...please

Imports System.Data.OleDb
Imports System.Data

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim Conn As OleDbConnection
Dim da As OleDbDataAdapter
Dim sConn As String
Dim sComm As String
Dim ds As New DataSet

'ViewState("i") = 0

'Build the connection string
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;"
sConn += " Data Source=C:/kavitha1.mdb;"
'sConn += "Data Source=C:\Inetpub\wwwroot\kavitha1.mdb;"
sConn += "Persist Security Info=False"

'Build the SQL string sComm = "SELECT Products.ProductID, "

sComm = "SELECT class,command,parameter,return,delay FROM Table2"

'Usually you would use error-handling here. It is left out to
'make the code as simple as possible.

'Create the connection and command objects
Conn = New OleDbConnection(sConn)
da = New OleDbDataAdapter(sComm, Conn)

'Fill the dataset with the results of the query
da.Fill(ds, "Table2")

'Set the grid source to the dataset and bind the data
''GridView1.DataSource = ds.Tables("Table1").DefaultView
''GridView1.DataBind()

GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()

count = ds.Tables(0).Rows.Count


End Sub
Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Init
ViewState("i") = 0
End Sub

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
'Dim d As Integer
'For d = 0 To 4
' Response.Write("In the For Loop")
'Next d
'Dim f As Integer


'Response.Write("The Loop ran " & f & "times")

'For i = 5 To 16

' Response.Write("You are " & i + 1 & ".")
' Response.Write("Go to school.<br>")
'Next
'Response.Write("School's out!")

'Dim p As Integer
'p = 0
'While p <= 5
' p = p + 1
' Response.Write(p)
'End While
'Return

Timer1.Interval = 1000 '1000 = 1 second
Timer1.Enabled = True
End Sub


Dim count As Integer = 0
Dim index As Integer = 0
Dim delay As Integer = 0
Dim looping As Integer


Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick

index = CInt(ViewState("i").ToString()) Mod count
GridView1.Rows(index).BackColor = Drawing.Color.GreenYellow
GridView1.Rows(index).Font.Bold = True
If (index = 0) Then

GridView1.Rows(count - 1).BackColor = Drawing.Color.White
GridView1.Rows(count - 1).Font.Bold = False
Else
GridView1.Rows(index - 1).BackColor = Drawing.Color.White
GridView1.Rows(index - 1).Font.Bold = False
End If
ViewState("i") = CInt(ViewState("i")) + 1
txtLoop.Text = CInt(ViewState("i"))


End Sub


Protected Sub btnStop_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnStop.Click

Timer1.Enabled = False
'Let the highlighten row stay highlighten

index = (CInt(ViewState("i").ToString()) - 1) Mod count
GridView1.Rows(index).BackColor = Drawing.Color.Red
GridView1.Rows(index).Font.Bold = True
End Sub
End Class


kavidream24
kavidream24 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Delay in Toshiba HD Player Alpha DVD Video 2 02-12-2006 10:27 PM
Toshiba to delay HD DVD player launch Allan DVD Video 12 12-27-2005 03:45 PM
Toshiba hints at HD DVD launch delay. Allan DVD Video 3 09-02-2005 03:32 AM
Bush administration will delay major assaults until after U.S. elections jasmine DVD Video 9 10-14-2004 12:30 AM
Disney Treasures 3 Delay: Tin Can Alley. Scot Gardner DVD Video 0 11-16-2003 11:56 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46