Ask a Question related to ASP.NET General, Design and Development.
-
John Saunders #1
Re: Question: How check if datareader is null?
"VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
news:eGmnp2MYDHA.1784@TK2MSFTNGP09.phx.gbl...If Not (drReader Is Nothing) Then ...> I have a datareader that I use in my Try block. In the Finally I want to
> close the datareader, but ONLY if it is not null/nothing. How can I do
> this?
>
> I've tried these already...
> If drReader <> Nothing Then...
> If drReader Is Not Null Then...
> If drReader Is Not System.DbNull Then...
>
> None work. Ideas?
--
John Saunders
Internet Engineer
[email]john.saunders@surfcontrol.com[/email]
John Saunders Guest
-
Check for null query
I have some code something like this in a query of a query: SELECT query1.field1, query1.field2, query1.field3 FROM query1 WHERE field1 not in... -
Simple Dumb Question - Null for Date/Time Field
using cf mx ms sql 2000. i have an update form that contains a field for date a procedure was signed. the problem is if the procedure was not... -
how to to check array Null value on coldfusion 7
Hi, How do you check the array elements empty or not. for example, I have array - array , and from array to array has some value, and there... -
Spell check question
Is it possible to run a spell check on a locked file???? I realize you can not change anything, but it would be helpfull to at least know if there is... -
Check for Null In Conditional Formating
Try the expression: IsNull() -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users -... -
Ravikanth[MVP] #2
Question: How check if datareader is null?
Hi
Try this:
finally
' Always call Close when done reading.
if Not (myDataReader is Nothing)
myDataReader.Close()
end if
Ravikanth[MVP]
Finally I want to>-----Original Message-----
>I have a datareader that I use in my Try block. In thenull/nothing. How can I do>close the datareader, but ONLY if it is not>this?
>
>I've tried these already...
> If drReader <> Nothing Then...
> If drReader Is Not Null Then...
> If drReader Is Not System.DbNull Then...
>
>None work. Ideas?
>
>Thanks!
>
>
>.
>Ravikanth[MVP] Guest
-
VB Programmer #3
Re: Question: How check if datareader is null?
Thanks Ravikanth!
"Ravikanth[MVP]" <dvravikanth@hotmail.com> wrote in message
news:0d7b01c360cf$96eee040$a401280a@phx.gbl...> Hi
>
> Try this:
> finally
> ' Always call Close when done reading.
> if Not (myDataReader is Nothing)
> myDataReader.Close()
> end if
>
> Ravikanth[MVP]
>
>> Finally I want to> >-----Original Message-----
> >I have a datareader that I use in my Try block. In the> null/nothing. How can I do> >close the datareader, but ONLY if it is not> >this?
> >
> >I've tried these already...
> > If drReader <> Nothing Then...
> > If drReader Is Not Null Then...
> > If drReader Is Not System.DbNull Then...
> >
> >None work. Ideas?
> >
> >Thanks!
> >
> >
> >.
> >
VB Programmer Guest
-
VB Programmer #4
Re: Question: How check if datareader is null?
Thanks John!
"John Saunders" <john.saunders@surfcontrol.com> wrote in message
news:uzdPK7MYDHA.2632@TK2MSFTNGP09.phx.gbl...to> "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
> news:eGmnp2MYDHA.1784@TK2MSFTNGP09.phx.gbl...> > I have a datareader that I use in my Try block. In the Finally I want>> > close the datareader, but ONLY if it is not null/nothing. How can I do
> > this?
> >
> > I've tried these already...
> > If drReader <> Nothing Then...
> > If drReader Is Not Null Then...
> > If drReader Is Not System.DbNull Then...
> >
> > None work. Ideas?
> If Not (drReader Is Nothing) Then ...
>
> --
> John Saunders
> Internet Engineer
> [email]john.saunders@surfcontrol.com[/email]
>
>
VB Programmer Guest



Reply With Quote

