Home All Groups Group Topic Archive Search About

Referencing field value in a dataset

Author
18 Nov 2005 5:12 PM
Phenom
I'm trying to pull a specific piece of data from a dataset.

In old asp, it would have been something like:

rst("fieldname") - rst being the name of my recordset.

How can I do this with a dataset?

I've tried several things and can't find a way to check the value of a
field.

Author
18 Nov 2005 6:43 PM
Cor Ligthert [MVP]
Phenon,

Than you first have to tell what piece.

A recordset is in no way to compare with a dataset the closest equivalent
with a recordset is a datatable. As that holds the same as the recordset
only one database table at a time.

Cor
Author
18 Nov 2005 6:44 PM
Cor Ligthert [MVP]
Hi,

I see now the subject that you want an item value.

See it as this

ds.Tables(0).datarow(0)("fieldname")

Wich is the first fieldname in your first row from your first table in your
dataset.

Cor
Author
18 Nov 2005 7:00 PM
Phenom
Thank you. I was on the right track, but instead of
ds.Tables(0).datarow(0)("fieldname")
I had ds.Tables(0).datarow(0).item("fieldname")

AddThis Social Bookmark Button