dataset basic navigation

  • Thread starter Thread starter jherl
  • Start date Start date
J

jherl

Hi, Please forgive me for the simplicity of the question, and the
redundancy. I have searched the forum and believe my answer is out
there amongst the multiple dataset question/responses, but I am such
a newbie that I am having trouble putting together the information I
need...Ok, enough, here's what I am trying to do:

I am making a call to a third party API that returns a dataset. I need
find out if there are any rows returned, and if so pull out the data
from a couple of the columns...

More specifically, I get the dataset. Each row contains many columns,
the three I need to get are BuySell, ControlValue, and Price.

Can someone toss out to me the simple code for traversing through the
dataset and pulling out the values from these columns.

Many Thanks -
Jennifer

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
jherl said:
Hi, Please forgive me for the simplicity of the question, and the
redundancy. I have searched the forum and believe my answer is out
there amongst the multiple dataset question/responses, but I am such
a newbie that I am having trouble putting together the information I
need...Ok, enough, here's what I am trying to do:

I am making a call to a third party API that returns a dataset. I need
find out if there are any rows returned, and if so pull out the data
from a couple of the columns...

More specifically, I get the dataset. Each row contains many columns,
the three I need to get are BuySell, ControlValue, and Price.

Can someone toss out to me the simple code for traversing through the
dataset and pulling out the values from these columns.

Many Thanks -
Jennifer

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

If you have a dataset here is some sample code to get data from it..

Assuming your dataset is named "ds"

'Get the number of Rows in the table
ds.Tables("TABLE_NAME").Rows.Count

'Enumerate through the rows in a data Table
Dim dr as DataRow

For Each dr in ds.Tables("TABLE_NAME").Rows
dr("COLUMN_NAME1 or INDEX").ToString()
dr("COLUMN_NAME2 or INDEX").ToString()
Next
 

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

Similar Threads


Back
Top