Solved

Undefined function 'IsDBNull' in expression

Posted on 2004-03-24
3
799 Views
Last Modified: 2006-11-17
I have a sql statement that pulls data from ms access db if the date in the table is null or greater or equals to today's date.
I am converting asp to asp.net. In my WHERE clause I had
WHERE  (isNull(endDate)  OR endDate >= Date())

after converting to .net I got

WHERE (IsDBNull(endDate) OT endDate >= DateTime.Now)

But now I'm getting an error Undefined function 'IsDBNull' in expression.

I mported System.DBNull.
What am I doing wrong?
0
Comment
Question by:YZlat
3 Comments
 
LVL 9

Expert Comment

by:msdixon
Comment Utility
if this is from a sql statement change it back to isnull.

if this is vb code you can use
endDate = DBNull.Value

to see if a value is null
0
 
LVL 35

Author Comment

by:YZlat
Comment Utility
where do I put this line endDate = DBNull.Value?
in my sql statement?


I have "SELECT * FROM Table1 WHERE (IsDBNull(endDate) OT endDate >= DateTime.Now)"
0
 
LVL 7

Accepted Solution

by:
dante469 earned 50 total points
Comment Utility
The WHERE clause will run on the SQL server and must use SQL syntax...

Depending on your version of SQL that may change however this will work on SQL 6.5 or above..

           WHERE  ((endDate Is Null)  OR endDate >= GetDate() )

Have Fun,
Dante
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now