G
Guest
Hi
i have function like above
Public Sub halytystutkinta()
Dim ds As New DataSet
ds = dl2.HaeHalytys()
Dim onkohal As Int16
onkohal = ds.Tables(0).Rows(0).Item("onkohalytys")
halid = ds.Tables(0).Rows(0).Item("halid")
If onkohal = 1 Then
Beep()
Label2.Text = "Halytys, halytys"
Image1.DataBind()
Beep()
End If
End Sub
and i try to use that function with timer like this
Private Sub OnTimer(ByVal source As Object, ByVal e As System.Timers.ElapsedEventArgs)
otakuva()
End Sub
Private Sub KaynnistaPalvelu()
AddHandler aTimer.Elapsed, AddressOf OnTimera
aTimer.Interval = 20000
aTimer.Enabled = True
end sub
but that doesnt not work
but if i call if call function halytystutkinta
like above it works
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
halytystutkinta()
End Sub
it is asp.net application
i have function like above
Public Sub halytystutkinta()
Dim ds As New DataSet
ds = dl2.HaeHalytys()
Dim onkohal As Int16
onkohal = ds.Tables(0).Rows(0).Item("onkohalytys")
halid = ds.Tables(0).Rows(0).Item("halid")
If onkohal = 1 Then
Beep()
Label2.Text = "Halytys, halytys"
Image1.DataBind()
Beep()
End If
End Sub
and i try to use that function with timer like this
Private Sub OnTimer(ByVal source As Object, ByVal e As System.Timers.ElapsedEventArgs)
otakuva()
End Sub
Private Sub KaynnistaPalvelu()
AddHandler aTimer.Elapsed, AddressOf OnTimera
aTimer.Interval = 20000
aTimer.Enabled = True
end sub
but that doesnt not work
but if i call if call function halytystutkinta
like above it works
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
halytystutkinta()
End Sub
it is asp.net application