Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
AnswerRe: Dataset Looping Pin
Ed.Poore16-Feb-07 1:07
Ed.Poore16-Feb-07 1:07 
GeneralRe: Dataset Looping Pin
#realJSOP16-Feb-07 2:02
professional#realJSOP16-Feb-07 2:02 
GeneralRe: Dataset Looping Pin
Ed.Poore16-Feb-07 2:10
Ed.Poore16-Feb-07 2:10 
GeneralRe: Dataset Looping Pin
kubben16-Feb-07 2:12
kubben16-Feb-07 2:12 
AnswerRe: Dataset Looping Pin
Chris Buckett16-Feb-07 1:15
Chris Buckett16-Feb-07 1:15 
GeneralRe: Dataset Looping Pin
#realJSOP16-Feb-07 2:00
professional#realJSOP16-Feb-07 2:00 
GeneralRe: Dataset Looping Pin
Chris Buckett16-Feb-07 2:04
Chris Buckett16-Feb-07 2:04 
GeneralRe: Dataset Looping Pin
Chris Buckett16-Feb-07 2:19
Chris Buckett16-Feb-07 2:19 
John Simmons / outlaw programmer wrote:
plain for loop, it works fine.


Ok, I've had a bit of a think about it.

The for loop knows in advance how many rows / tables there are, and when it hits that limit it stops.

The foreach will keep going until it gets to the end. If your code adds a row / table to the dataset, then the foreach will then check that row / table (resulting in another execution of the inner code and another row / table being added (although I know you said there was no recursion, but that seems like the most likely scenario from the data I have available).

Why not do an overloaded version of that method that accepts a datatable rather than a dataset? then you only need to loop through the datarows in that table and load an employee for each.

ChrisB.



ChrisB
ChrisDoesDev[^]

GeneralRe: Dataset Looping Pin
Todd Smith16-Feb-07 7:42
Todd Smith16-Feb-07 7:42 
AnswerRe: Dataset Looping Pin
megaadam16-Feb-07 2:20
professionalmegaadam16-Feb-07 2:20 
AnswerRe: Dataset Looping Pin
Jon Sagara16-Feb-07 3:46
Jon Sagara16-Feb-07 3:46 
GeneralRe: Dataset Looping Pin
#realJSOP16-Feb-07 4:11
professional#realJSOP16-Feb-07 4:11 
QuestionSome issues in strong naming .net dlls Pin
f4hd15-Feb-07 9:48
f4hd15-Feb-07 9:48 
AnswerRe: Some issues in strong naming .net dlls Pin
Luc Pattyn15-Feb-07 15:20
sitebuilderLuc Pattyn15-Feb-07 15:20 
GeneralRe: Some issues in strong naming .net dlls Pin
f4hd16-Feb-07 8:03
f4hd16-Feb-07 8:03 
QuestionIntellisense and DLL Pin
DISP-Jol15-Feb-07 8:38
DISP-Jol15-Feb-07 8:38 
AnswerRe: Intellisense and DLL Pin
Luc Pattyn15-Feb-07 9:29
sitebuilderLuc Pattyn15-Feb-07 9:29 
GeneralRe: Intellisense and DLL Pin
DISP-Jol16-Feb-07 4:17
DISP-Jol16-Feb-07 4:17 
GeneralRe: Intellisense and DLL Pin
Luc Pattyn16-Feb-07 7:51
sitebuilderLuc Pattyn16-Feb-07 7:51 
QuestionInt and string values Pin
Raymond_P*15-Feb-07 8:27
Raymond_P*15-Feb-07 8:27 
AnswerRe: Int and string values Pin
mehrcpp15-Feb-07 8:42
mehrcpp15-Feb-07 8:42 
GeneralRe: Int and string values Pin
Raymond_P*15-Feb-07 8:52
Raymond_P*15-Feb-07 8:52 
AnswerRe: Int and string values Pin
mehrcpp15-Feb-07 9:43
mehrcpp15-Feb-07 9:43 
AnswerRe: Int and string values Pin
Guffa15-Feb-07 9:31
Guffa15-Feb-07 9:31 
AnswerRe: Int and string values Pin
Luc Pattyn15-Feb-07 9:32
sitebuilderLuc Pattyn15-Feb-07 9:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.