Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IsDBNull: easy question

Status
Not open for further replies.

eramgarden

Programmer
Aug 27, 2003
279
US
I get this error:
Argument not specified for parameter 'Expression' of 'Public Function IsDBNull(Expression As Object) As Boolean'.


when I do : if not IsDBNull.lngPriorityId then

But if I have if lngPriorityId <> 0 then it works...

I have defined lngPriorityId in &quot;dim lngPriorityId&quot;...

now, i have another variabe :if (Not IsDBNull(lngPsId)) then and this does NOT give me an error...

why???
 
Hi eramgarden,

I have not been working with .Net for very long but I think I can answer your question.

You have set IsDBNull as a function that requires a parameter to be passed to it. That is why your second item works is that you are using it the way you have set it up.

The first one does not work for that same reason. When you have a function you have to pass in the variables to it from within parentheses and not using the dot framework like you attempted.

I hope that what I said here is correct. If it is not then maybe someone with more experience can explain it better.

Hope this helps.

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top