473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to handle null values

how should i hanle null values returned by the datareader
i am using OleDbDataReader for accessing access database.

Oct 17 '06 #1
3 1773
Typically you would first check if the value is null with IsDbNull method.
If it is not, you can get the value with one of the GetXxx methods

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"psycho" <pa***********@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
how should i hanle null values returned by the datareader
i am using OleDbDataReader for accessing access database.

Oct 17 '06 #2
use IsDBNull.value
Patrick

"psycho" <pa***********@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
how should i hanle null values returned by the datareader
i am using OleDbDataReader for accessing access database.

Oct 17 '06 #3
There's a SafeDataReader in the CSLA.NET which takes care of this for you.

Here's the VB.NET version:
http://www.lhotka.net/Article.aspx?i...3-8b5bda6bad22

there's a C# one somewhere on the site...

Karl

--
http://www.openmymind.net/
http://www.codebetter.com/
"psycho" <pa***********@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
how should i hanle null values returned by the datareader
i am using OleDbDataReader for accessing access database.

Oct 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dean | last post by:
I am a developer who works with MS SQL Server a lot, but I'm far from an expert. I am revamping an appointment scheduling system that allows for appointments to reoccur daily, weekly, monthly and...
27
by: gmtonyhoyt | last post by:
I need assistance coming up with a clean way to handle filename extensions with my application. While I can come up with several ways of doing so on my own, I felt perhaps it would be worth...
3
by: Frank Perry | last post by:
Howdy, I'm trying to write data out the com port. I have taken the code from the sample on the MSDN Library CD and used the parts that seem relevant. I can open the com port with CreateFile...
6
by: Leandro Berti via DotNetMonster.com | last post by:
Hi All, I wrote a code to do serial communication with an equipament. When i use the code outside of threaded class it seens work properly, but when i put inside a class and execute a thread in...
6
by: Dean Slindee | last post by:
I am looking for the "right" way to handle inserting and presenting null date values. Public Const c_NullDate As Date = #12:00:00 AM# If I set the value of a date variable in an SQL Server insert...
0
by: Jason Coyne | last post by:
Here is another programming blog entry. Sorry for the normal friends :) I recently ran into a problem with a web service I was trying to call from c# where the web service returned null dates...
19
by: rich | last post by:
I am building an app using php and postgresql. My questionis this. How do you handle people wanting to make parallel changes to a record. Since in web apps you are doing a select, bring over a...
3
by: stefan.albert | last post by:
Hello, I'm interested in the application handle the session has. Is there a way to return it (UDF) so I can protocol it into a table (or something like that)? e.g. "values myapphandle()"
9
by: jakeesgirl | last post by:
I'm developing a C# application in Visual Studio that have forms which insert values into an sql database. I am allowing null values in the database. However, I have some combo boxes on the forms...
5
by: dhanashivam | last post by:
Hi all, In my table there is a varchar column having NULL and string names. while i am running select on this table the NULL values are not returned. the statement returns only non null...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.