B
Bob
Hi,
If the test is true, the message 'not available' must be shown and quit the
program.
But when the test is true and when table 'data2' is empty (so nrg=0), i get
the error:"dividing by zero". Why? The program should quit, no?
Thanks
Bob
the code:
.....
x= Date.Now
sql = "select begindate from mydate"
comd = New OleDbCommand(sql, oConnection)
dtreader = comd.ExecuteReader
dtreader.Read()
If x <= dtreader.GetDateTime(0) Then 'compare today with date
in table
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(),
"myscript", _
" alert(not available);" & _
" window.location.href='http://www..../';", True)
End If
' should stop here if test is true
dim z, nrg as integer
sql = "select count(*) from data2 ;"
comd = New OleDbCommand(sql, oConnection)
nvrg = comd.ExecuteScalar
z=10/nrg
.....
If the test is true, the message 'not available' must be shown and quit the
program.
But when the test is true and when table 'data2' is empty (so nrg=0), i get
the error:"dividing by zero". Why? The program should quit, no?
Thanks
Bob
the code:
.....
x= Date.Now
sql = "select begindate from mydate"
comd = New OleDbCommand(sql, oConnection)
dtreader = comd.ExecuteReader
dtreader.Read()
If x <= dtreader.GetDateTime(0) Then 'compare today with date
in table
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(),
"myscript", _
" alert(not available);" & _
" window.location.href='http://www..../';", True)
End If
' should stop here if test is true
dim z, nrg as integer
sql = "select count(*) from data2 ;"
comd = New OleDbCommand(sql, oConnection)
nvrg = comd.ExecuteScalar
z=10/nrg
.....