473,545 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1800
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.goog legroups.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.goog legroups.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.goog legroups.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
4368
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 yearly. Currently, I am saving the appointment date as the initial appointment date. Then when I want to check for appointments, my stored proc...
27
4603
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 asking here to see what more effective or accepted methods for doing would be presented. The issue is this. My application accepts files names,...
3
5252
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 and get a valid file handle back. But when I try to write to it, the WriteFile comes back and tells me the handle is invalid. The program has...
6
2841
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 the first seconds the communication is ok, later i receive read/write error. I?ve been in MSDN site and there i discover that the read/write error...
6
12982
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 statement to c_NullDate, the insert statement works. When I re-read the row and display the inserted date value in a text box, the string...
0
2299
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 (and other null values on elements that end up de-serialized as value types) I didn't find any good solutions online (other than wait for nullable...
19
1696
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 record then updating it, there is no lock on that record while you are making the changes in your browser window. Does transactions handle that? Do...
3
4367
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
2419
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 that give me an error when I insert the form values into the database. It allows me to have null values in the textboxes, but not the combo boxes. ...
5
2351
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 values. my query is SELECT EMP_ID, AGE FROM EMPLOYEE WHERE EMP_NAME <> 'BABU' in my table there is records with null values. but it retuns only non...
0
7398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7805
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7752
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5325
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1878
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.