Home All Groups Group Topic Archive Search About

Retrieving a single value from a dataset

Author
5 Apr 2006 12:22 AM
MarkAurit
Im using a data access layer that pulls everything back as a dataset.  They
arent exposing the scalar return.
The dataset is  populated with a single value from a database, the max() of
a date.
How is the fastest way to get a single value from a dataset consisting only
of that value?
Thanks, Mark

Author
5 Apr 2006 12:33 AM
Jim Hughes
dim dt as DateTime = ctype(ds.Tables(0).Rows(0).Item(0), DateTime)
or
DateTime dt = (DateTime) ds.Tables(0).Rows(0).Item(0);

Show quote
"MarkAurit" <MarkAu***@discussions.microsoft.com> wrote in message
news:5A4CFD6B-383E-442E-AFDB-B82F8194BD79@microsoft.com...
> Im using a data access layer that pulls everything back as a dataset.
> They
> arent exposing the scalar return.
> The dataset is  populated with a single value from a database, the max()
> of
> a date.
> How is the fastest way to get a single value from a dataset consisting
> only
> of that value?
> Thanks, Mark

AddThis Social Bookmark Button