I'm building a web app using ASP.NET 4 with Visual Basic.
I've written a function - basically a lookup function - that uses input parameters to find the matching record ID. If it finds a match, it should return the ID number, but if it doesn't it should return DBnull.value.
I found nullable types and declared the function As Nullable(of Integer), thinking that would solve it. But then I learned that nullable doesn't mean null, it means nothing!
So, when the lookup function doesn't find a match, it returns nothing instead of null. I realize I could test the returned value and if it is nothing then use Dbnull for the value in the new record, but I call this function many times and that approach seems so cumbersome. Is there any way to handle this situation one time in the function?