Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2005

Tip: Looking for answers? Try searching our database.

checking for a null in a bit datatype field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris - 30 Sep 2005 17:19 GMT
Hi,

I have an SQL Query that loads a SQLDataReader object.

The returned record has bit datatype columns that I use to provide
true/false values.

I can't get a definite answer googling on how to test if this field is null.

I get casting errors, and can't check for null on a null data value errors
messages.

can someone point me to a definite article on checking for nulls using an
SQLDataReader

or

the code (C#) on testing for null value?

thanks

Chris
Mark White - 30 Sep 2005 17:23 GMT
Check it against System.DBNull.Value.  That will give the desired results.

> Hi,
>
[quoted text clipped - 18 lines]
>
> Chris
Ron - 30 Sep 2005 18:37 GMT
Your instance of SqlDataReader has a function for that purpose: IsDBNull.

> Hi,
>
[quoted text clipped - 18 lines]
>
> Chris

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.