473,396 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to access a dataset value?

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


Nov 19 '05 #1
1 929
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();

"Shapper" wrote:
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


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

49
by: Relaxin | last post by:
It is just me or has MS created some of the worst ways to access and display data? You can use a DataSet, but if you want to sort or filter the data to must use a DataView which is created from...
0
by: sedefo | last post by:
I ran into this Microsoft Patterns & Practices Enterprise Library while i was researching how i can write a database independent data access layer. In my company we already use Data Access...
1
by: JH | last post by:
I have a comma delimited file and I want to export it to an MS access table already designed with appropriate field names. How do I do this programmatically using VB.NET or C#? Thanks for any...
16
by: Mr. B | last post by:
VB.net 2003; MS Access db; Netframe 1.1 I wrote an Windows app for my last place of employment that opened and modified a couple of MS Access db files. I did most of my programming at home on...
15
by: philip | last post by:
On a form, I have a datagridview. This datagridview is constructed on a dataset filled by a tableadapter. The table adapter do very well what it must do when filling dataset. Insertions,...
2
by: asad | last post by:
hello, how ru all pls tell me how can i create DAL and how can i use it in my ASP.NET pages thanks
1
by: Rico | last post by:
I have tried to access a database using asp.net. after some entries like 120+, I got an unspecified error message. Anyone know what is happening, it seems to be stuck at the same line even when i...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
1
by: elena | last post by:
Hi, All Please, help I have .NET 1.1 and MS Access, i am reading text file into MS Access table, 1. I did it with following statments; OleDbConnection conn = null; conn = new...
1
by: The_Fakir_42 | last post by:
Hi, I have a very tricky problem... I import an XLS file from my asp web application; this xls file contains lots of single-cell named areas. Usually, I know how to get them, this way : '...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.