> > Hi,
>
[quoted text clipped - 35 lines]
> convert a null to a double. You gotta investigate why
> drPost("PostAverageRating") is null.
But the point is that some of the records might have null fields. So
if a field is null the correspondent class property would become
Nothing.
Are you saying that for each conversion i need to check if
drPost(.......) is null and make the conversion just after it?
Isn't there a straight forward way to give the Nothing value to class
property when drPost(.......) is null?
Thanks,
Miguel
gnewsgroup - 12 Oct 2007 17:24 GMT
> > > Hi,
>
[quoted text clipped - 47 lines]
> Thanks,
> Miguel
First of all, I think it is suggested that we always check if it is a
null before we attempt to use the value.
Second, converting a null to a Double simply does not happen.
Peter Bromberg [C# MVP] - 12 Oct 2007 17:27 GMT
just test the item for IsDbNull or =DbNull.Value. If it is, you can give the
property say a default value of zero and no exception will be thrown.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
> > > Hi,
> >
[quoted text clipped - 47 lines]
> Thanks,
> Miguel
bruce barker - 12 Oct 2007 19:18 GMT
thats correct.
in .net value types like double, int, date, etc, do not support null
(nothing) as value, so a function returning a double, can not return null.
-- bruce (sqlwork.com)
>>> Hi,
>>> I am trying to fill a Generic.List(Of MyClass) with a dataset row
[quoted text clipped - 34 lines]
> Thanks,
> Miguel