I have the following code, but when I run it, and the query that its data is derived returns a row, and that row has a value of Null
If dr.HasRows Then
Attempt = dr.Item("attempt")
If Attempt = Nothing Then
txtAttemptNumber.Text = 1
txtAttemptNumber.Text = Attempt
I get the following error:
Cast from type 'DBNull' to type 'Integer' is not valid.
Can anybody see how to fix this, please?