?
Solved

VB.Net - DataTable Get Back to First Row

Posted on 2013-01-21
2
Medium Priority
?
310 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 1580 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

764 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