Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: isDBNull and Expected End of Statment Error


Message #1 by "Jose Haymaker" <ehaymaker@a...> on Mon, 3 Dec 2001 21:11:37
I have some fields in the table which may be null, and if they are, I want 

to ignore them.



In classic as I could say if rs("a"&i) isNull then



but the error page says to use DBNull, so when I use is DBNUll, I get an 

error "expected end of statement"



Anyone know how to use DBNull in the situtation?



 <% if myDataReader.("a"&i) isDBNull  %>
Message #2 by "Jose Haymaker" <ehaymaker@a...> on Mon, 3 Dec 2001 21:35:08



I figured out its done like this, but what if I want to do nothing if it 

is null:  Is it ok just to jump from if to Else with nohting in between?



<%if isDBNULL(myDataReader.item("a"&i))%>

ELSE

do something%>
Message #3 by "Mark Struck" <struckm@a...> on Mon, 3 Dec 2001 17:17:27 -0600
Jose,



Just use the ! Operator, like this



if !isDBNull(myDataReader.item("a"&i))



Mark



-----Original Message-----

From: Jose Haymaker [mailto:ehaymaker@a...] 

Sent: Monday, December 03, 2001 9:35 PM

To: ASP+

Subject: [aspx] Re: isDBNull and Expected End of Statment Error









I figured out its done like this, but what if I want to do nothing if it



is null:  Is it ok just to jump from if to Else with nohting in between?



<%if isDBNULL(myDataReader.item("a"&i))%>

ELSE

do something%>

---

VBug Winter Conference 2001 



Open Forum:  Dan Appleman will be hosting an open 

forum at The .NET Developer's Conference on 

29th November 2001.  The session will give 

developers the chance to discuss and question 

Dan on his experience with the .NET environment.  

Dan has been programming Visual Basic since the 

alpha version 1.0.  And with over 10 years 

Visual Basic experience is well qualified to 

help you on your road to being a .NET Guru.



http://www.vbug.co.uk/redirect.asp?url=39&id=17



---

You are currently subscribed to 

aspx as: struckm@a...


$subst('Email.Unsub')




  Return to Index