T
tshad
In VS 2008,
I have an object, dbReader, that I get a warning saying that it is used
before it has been assigned a value.
That is correct.
Dim dbReader As SqlDataReader
and later:
Finally
If (Not dbReader Is Nothing) Then dbReader.Close()
End Try
Why is this an error?
Here I am testing to see if it is nothing, which it is (isn't it?) before
using it. The error is in the "if" test not the dbReader.Close().
Thanks,
Tom
I have an object, dbReader, that I get a warning saying that it is used
before it has been assigned a value.
That is correct.
Dim dbReader As SqlDataReader
and later:
Finally
If (Not dbReader Is Nothing) Then dbReader.Close()
End Try
Why is this an error?
Here I am testing to see if it is nothing, which it is (isn't it?) before
using it. The error is in the "if" test not the dbReader.Close().
Thanks,
Tom