Home All Groups Group Topic Archive Search About

Viewing Data from a DataSet

Author
21 Mar 2006 8:29 PM
glenn
Hello,

I have a DataSet that was returned to me by a QueryMethod( ).

I have drilled down to the column level as follows:

                Dim ds As System.Data.DataSet
                Dim dt As System.Data.DataTable
                Dim dr As System.Data.DataRow
                Dim dc As System.Data.DataColumn

                ds = QueryMethod ( )

                For Each dt In  ds.Tables
                    For Each dr In  dt.Rows
                       For Each dc In  dt.Columns
                            if dr(dc) = "owner" then
                                ' GET THE DATA IN THE COLUMN OF A ROW OF A
TABLE
                             end if
                       Next dc
                    Next dr
                Next dt

Am I using the right approach.  Thanks for any replies.

Author
21 Mar 2006 9:13 PM
Kevin Spencer
Without a context, there is no "right approach." There are multiple
approaches because there are multiple circumstances.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

Show quote
"glenn" <gl***@discussions.microsoft.com> wrote in message
news:1F2AB0FC-B011-41F4-A05B-90ECCFE805C0@microsoft.com...
> Hello,
>
> I have a DataSet that was returned to me by a QueryMethod( ).
>
> I have drilled down to the column level as follows:
>
>                Dim ds As System.Data.DataSet
>                Dim dt As System.Data.DataTable
>                Dim dr As System.Data.DataRow
>                Dim dc As System.Data.DataColumn
>
>                ds = QueryMethod ( )
>
>                For Each dt In  ds.Tables
>                    For Each dr In  dt.Rows
>                       For Each dc In  dt.Columns
>                            if dr(dc) = "owner" then
>                                ' GET THE DATA IN THE COLUMN OF A ROW OF A
> TABLE
>                             end if
>                       Next dc
>                    Next dr
>                Next dt
>
> Am I using the right approach.  Thanks for any replies.
>

AddThis Social Bookmark Button