Groups | Blog | Home
all groups > dotnet general > february 2004 >

dotnet general : How to find if a value is null


Jiten
2/29/2004 4:36:06 PM
Hi

I have run a stored proc against a database to retrieve a list of date values. What i wanted to do is to add the values returned to an arraylist if the value is not null.

here is a small portion of my code that i am using...

Tr
MyConn.Open(
Dim rdr As SqlDataReade
rdr = SPretDate.ExecuteReader(
rdr.Read(
Dim FlightDate As String = (rdr.GetSqlDateTime(0).ToString

'if flightDate is not Null the
FlightDateArrayList.Add(FlightDate
'End i

I also wanted to minus 1 date from another to get the number of days gap
i.e in Psedo code...
daysGap = FlightDate - Flightdate

Im also stuck on how to achieve this. Can anyone offer any assistance
many th
Scott M.
2/29/2004 9:47:32 PM
if Not IsDBNull(flightDate) then
FlightDateArrayList.Add(FlightDate )
End if


I also wanted to minus 1 date from another to get the number of days gap.
daysGap = FlightDate.subtract(Flightdate2)



[quoted text, click to view]
values. What i wanted to do is to add the values returned to an arraylist if
the value is not null.
[quoted text, click to view]

AddThis Social Bookmark Button