I just want to loop a dataset

Posted on 2006-04-16
Medium Priority
Last Modified: 2010-04-06
When a person clicks on a combo box the data is retrived with out a problem.  then I want to loop the dataset.

var ss=''
  while(business_ds.hasNext()) {
   var  q =  business_ds.currentItem.Question;
   var  a =  business_ds.currentItem.Answer;
    var author =  business_ds.currentItem.Author;
   ss += q;
   ss += a;
   ss += author;

this doesnt work for me

Whats wrong
Question by:theo1967
LVL 15

Accepted Solution

deepaknet earned 1000 total points
ID: 16466970
You can not loop through a dataset direct. DataSet constitutes multiple tables and you need to narrow down to the appropriate table and then loop through the records in the particular table.
LVL 35

Assisted Solution

YZlat earned 1000 total points
ID: 16469590
you can use JOIN to loop through a dataset. Here is an example:


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question