M
moondaddy
I have a dataset cached on the server and there are times I try to read from
it before much data has been added to it. when its initially created, I add
the user name and some base information but most of the columns are empty.
When I come back to it and try to read its data most columns are OK even
though I haven't entered any data yet. Their values will be "" or 0.
However I have some calculated columns based on expressions (which work OK
when the columns they use to compute have data), and when I try to read from
these columns before transaction data has been entered, I get an error msg:
Cast from type 'DBNull' to type 'Single' is not valid
I can understand why this is happening, but I need to evaluate if this
column is dbnull so I will know if I should try to get its value or not.
There's no property like IsDbNull I can use. Here's some suto code of what
I want to do:
if dr.myCol.IsDbNull then
or
if dr.myCol.DbNull.value = null then 'or something....
Thanks.
it before much data has been added to it. when its initially created, I add
the user name and some base information but most of the columns are empty.
When I come back to it and try to read its data most columns are OK even
though I haven't entered any data yet. Their values will be "" or 0.
However I have some calculated columns based on expressions (which work OK
when the columns they use to compute have data), and when I try to read from
these columns before transaction data has been entered, I get an error msg:
Cast from type 'DBNull' to type 'Single' is not valid
I can understand why this is happening, but I need to evaluate if this
column is dbnull so I will know if I should try to get its value or not.
There's no property like IsDbNull I can use. Here's some suto code of what
I want to do:
if dr.myCol.IsDbNull then
or
if dr.myCol.DbNull.value = null then 'or something....
Thanks.