Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2008 > BOOK: Professional Visual Basic 2008 ISBN: 978-0-470-19136-1
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Visual Basic 2008 ISBN: 978-0-470-19136-1
This is the forum to discuss the Wrox book Professional Visual Basic 2008 by Bill Evjen, Billy Hollis, Bill Sheldon, Kent Sharkey; ISBN: 9780470191361
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Visual Basic 2008 ISBN: 978-0-470-19136-1 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 21st, 2008, 01:25 PM
Registered User
 
Join Date: Aug 2008
Location: Falls Church, Virginia, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default The DBNull Class and IsDBNull Function

Pages 25,26
The code does not do what the text indicates that it does.
"The first conditional is evaluated to True."
--- The first conditional is NOT evaluated to TRUE


        Dim sysNull As System.DBNull = System.DBNull.Value
        Dim strMyString As String = Nothing

        If strMyString Is sysNull Then
            Console.WriteLine("1st condition is true") 'line_added
            strMyString = "Initialize my String"
        End If
        If Not IsDBNull(strMyString) Then
            Console.WriteLine("2nd condition is true") 'line_added
            Console.WriteLine(strMyString)
        End If
        Console.WriteLine("Done with dbNull test ") 'line_added


  #2 (permalink)  
Old September 27th, 2008, 09:13 AM
Registered User
 
Join Date: Sep 2008
Location: charlotte, nc, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You are correct. But this might have worked in a previous version of VB.NET, and the author of that code likely assumed it would still work. Either that, or the author THOUGHT that the code was correct but didn't bother to test it. That's about all I can think of right now.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
return collection by function in class jimusa Visual Basic 2005 Basics 1 July 30th, 2008 03:18 PM
function return collection in class by VB jimusa Visual Studio 2005 1 July 30th, 2008 03:12 PM
Running a class function c# rahilahmed C# 2 September 13th, 2007 11:19 AM
How do I make a function return a class? vertigo VB How-To 3 November 3rd, 2004 06:08 AM
Calling base class assignment function gstroud Visual C++ 8 September 23rd, 2004 02:33 AM



All times are GMT -4. The time now is 08:11 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.