How to access a dataset value?

S

Shapper

Hello,

I have a dataset which returns only one row.
I need to make an ASP:Image ImageURL equal to the dataset's imageURL
field.

I tried these two options:

iphoto.ImageURL = dsProduct("image01_url").ToString()
iphoto.ImageURL = dsProduct.Item("image01_url").ToString()

Both return an error. I know the second one works with a DataReader.

Can you tell me what am I doing wrong?

Thanks,
Miguel
 
G

Guest

Hi, You have to specify the datatable, indexes of row and column.

<dataset>.<datatable>.Rows(<rowIndex>)(<column index>).ToString();

For instance,

iphoto.ImageUrl=
dsProduct.Tables("Products").Rows(1)("Image01Url").ToString();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top