473,387 Members | 1,502 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,387 software developers and data experts.

Testing for nulls

I test for nulls with the following...

DataSetAnalyticalReportCountsAndSums1.tblTowers(0) .IsAvgSupplyTotalHardnessNull
But how do I test for nulls on myRow("AvgSupplyTotalHardness") in the code
below?

For Each myRow In
DataSetAnalyticalReportCountsAndSums1.tblTowers.Ro ws
'Sum the averages of each tower

dblValue = dblValue + myRow("AvgSupplyTotalHardness")

Next
I don't think isDBNull fnction works if the DB value is NULL
Thanks
Nov 19 '05 #1
2 1073
IsDBNULL works for testing for values that are equivalent to DBNull.Value.
So it should work in your case.

"Craig" <No****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I test for nulls with the following...

DataSetAnalyticalReportCountsAndSums1.tblTowers(0) .IsAvgSupplyTotalHardnessNull
But how do I test for nulls on myRow("AvgSupplyTotalHardness") in the code
below?

For Each myRow In
DataSetAnalyticalReportCountsAndSums1.tblTowers.Ro ws
'Sum the averages of each tower

dblValue = dblValue + myRow("AvgSupplyTotalHardness")

Next
I don't think isDBNull fnction works if the DB value is NULL
Thanks

Nov 19 '05 #2
Have you checked the DataTable.Compute Method. It is so much easier to Sum
the column values. Secondly checkout DBNull.Value to check for Null values
in Columns (something like If not Table1.ColumnName is DBNull.Value Then
....)

HTH

Trevor Benedict R
MCSD

"Craig" <No****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I test for nulls with the following...

DataSetAnalyticalReportCountsAndSums1.tblTowers(0) .IsAvgSupplyTotalHardnessNull
But how do I test for nulls on myRow("AvgSupplyTotalHardness") in the code
below?

For Each myRow In
DataSetAnalyticalReportCountsAndSums1.tblTowers.Ro ws
'Sum the averages of each tower

dblValue = dblValue + myRow("AvgSupplyTotalHardness")

Next
I don't think isDBNull fnction works if the DB value is NULL
Thanks

Nov 19 '05 #3

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

Similar topics

3
by: aaj | last post by:
Hi I am probably going to regret asking this because I'm sure you are going to tell me my design is bad 8-) ah well we all have to learn.... anyway I often use Nulls as a marker to see if...
6
by: mike | last post by:
I'm doing what I thought was a simple GROUP BY summary of fairly simple data and the my numbers aren't working out Some results are showing up <NULL> when I know the data is in the database ...
6
by: AAVF | last post by:
Hi We have a problem with a query. An Access database links via ODBC to a UNIX server. To speed things, we use the ODBC to load the relevant tables to the local PC that runs Access so that...
1
by: PST | last post by:
Here's a problem I'm trying to deal with: I'm working on a Frontpage 2000 website for a boat handicapping system, built in Access 97. What I'm trying to accomplish is: The user enters a...
5
by: John Smith | last post by:
Hey folks, I know this is an old topic, but I can't find a definitive answer on google. How do I tell if an int has been initialized or not? I had been testing it like: if(myInt ==...
4
by: a | last post by:
I'm having trouble testing a custom object. I've tried many different approaches. One is shown below. The XML below shows the state of the object and I'm trying to test for that state, ie there...
72
by: Jacob | last post by:
I have compiled a set og unit testing recommendations based on my own experience on the concept. Feedback and suggestions for improvements are appreciated: ...
6
by: Cliff72 | last post by:
I need to fill in the nulls in the batch field the value from the record immediately preceding the null one ie replace the nulls with the preceding value until I hit a record with a value in...
13
by: Fred Chateau | last post by:
I can't seem to find a test for DBNulls. Whatever I try doesn't work. for (int x = 0; x < dataSet.Identity.Rows.Count; x++) { DataRow dataRow = dataSet.Tables.NewRow(); if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.