Solved

VB.Net - DataTable Get Back to First Row

Posted on 2013-01-21
2
308 Views
Last Modified: 2013-01-21
Good Day Experts!

I am having trouble with this seeminlgy simple task.  I am converting a VB6 program that had a Do/Loop that ran a query each time through.  If certain data was encountered the loop is exitied.  Then the Do/Loop Reordset is reset back to the beginning with .MoveFirst.  

So, In my conversion I have:

DataTable that I am iterating through using a For/Next loop.  In it I run a query which may contain data that requires exiting from the loop.  

After I exit from the loop, I need to get back to the first row of the DataTable so I can iterate through it again.

How can I achieve this?

Thanks,
jimbo99999
0
Comment
Question by:Jimbo99999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 395 total points
ID: 38802621
Then run the foreach loop again. Or use the for next loop and reset the counter to 0.
0
 

Author Closing Comment

by:Jimbo99999
ID: 38802664
Thanks...I was staring at the For Each and "forgot" about the For Next with the counter.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

688 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