Click here to Skip to main content
15,894,106 members
Home / Discussions / C#
   

C#

 
QuestionHow to exit a while loop inside of a while loop Pin
TheJudeDude16-Nov-09 16:09
TheJudeDude16-Nov-09 16:09 
AnswerRe: How to exit a while loop inside of a while loop Pin
Abhijit Jana16-Nov-09 17:18
professionalAbhijit Jana16-Nov-09 17:18 
AnswerRe: How to exit a while loop inside of a while loop Pin
Shameel16-Nov-09 22:49
professionalShameel16-Nov-09 22:49 
GeneralRe: How to exit a while loop inside of a while loop Pin
Luc Pattyn17-Nov-09 1:28
sitebuilderLuc Pattyn17-Nov-09 1:28 
GeneralRe: How to exit a while loop inside of a while loop Pin
Shameel17-Nov-09 3:15
professionalShameel17-Nov-09 3:15 
GeneralRe: How to exit a while loop inside of a while loop Pin
Luc Pattyn17-Nov-09 3:33
sitebuilderLuc Pattyn17-Nov-09 3:33 
GeneralRe: How to exit a while loop inside of a while loop Pin
Shameel17-Nov-09 7:53
professionalShameel17-Nov-09 7:53 
AnswerRe: How to exit a while loop inside of a while loop Pin
Drew Stainton21-Nov-09 3:46
Drew Stainton21-Nov-09 3:46 
I don't quite understand your double while loop scenerio, but regardless, as far as I'm concerned, break is a Goto and they both should be burned at the stake.

Why not set a flag and include it in your while conditional? I find it much easier to follow code that tells you outright what the conditions are for continuing the loop:

salesTotalLoopFinished=false;
while (!salesTotalLoopFinished && dbreader.read())


Perhaps a better route to take, though, is to let the db handle the calculation for you:

SELECT SUM(daily_sales) AS total_sales FROM storedata WHERE storeid=25


Then you can avoid all of this looping in the first place.

Cheers,
Drew.
QuestionHow to exit a while loop inside of a while loop Pin
TheJudeDude16-Nov-09 16:07
TheJudeDude16-Nov-09 16:07 
AnswerRe: How to exit a while loop inside of a while loop Pin
Jaime Olivares16-Nov-09 16:38
Jaime Olivares16-Nov-09 16:38 
AnswerRe: How to exit a while loop inside of a while loop Pin
Jaime Olivares16-Nov-09 16:39
Jaime Olivares16-Nov-09 16:39 
GeneralRe: How to exit a while loop inside of a while loop Pin
TheJudeDude16-Nov-09 17:54
TheJudeDude16-Nov-09 17:54 
QuestionZoom Desktop like Windows 7 Magnifier? Pin
FocusedWolf16-Nov-09 15:43
FocusedWolf16-Nov-09 15:43 
AnswerRe: Zoom Desktop like Windows 7 Magnifier? Pin
Jaime Olivares16-Nov-09 16:30
Jaime Olivares16-Nov-09 16:30 
GeneralRe: Zoom Desktop like Windows 7 Magnifier? Pin
Jaime Olivares16-Nov-09 16:33
Jaime Olivares16-Nov-09 16:33 
GeneralRe: Zoom Desktop like Windows 7 Magnifier? Pin
FocusedWolf17-Nov-09 11:42
FocusedWolf17-Nov-09 11:42 
QuestionWebBrowser control without Form hosting Pin
csmanul16-Nov-09 15:26
csmanul16-Nov-09 15:26 
AnswerRe: WebBrowser control without Form hosting Pin
Luc Pattyn16-Nov-09 15:37
sitebuilderLuc Pattyn16-Nov-09 15:37 
GeneralRe: WebBrowser control without Form hosting Pin
csmanul17-Nov-09 1:28
csmanul17-Nov-09 1:28 
GeneralRe: WebBrowser control without Form hosting Pin
Luc Pattyn17-Nov-09 2:06
sitebuilderLuc Pattyn17-Nov-09 2:06 
AnswerRe: WebBrowser control without Form hosting Pin
Shameel16-Nov-09 22:54
professionalShameel16-Nov-09 22:54 
GeneralRe: WebBrowser control without Form hosting Pin
csmanul17-Nov-09 1:21
csmanul17-Nov-09 1:21 
GeneralRe: WebBrowser control without Form hosting Pin
Shameel17-Nov-09 3:19
professionalShameel17-Nov-09 3:19 
GeneralRe: WebBrowser control without Form hosting Pin
Shameel17-Nov-09 3:26
professionalShameel17-Nov-09 3:26 
QuestionGetting a console server to do more then connect Pin
bigjoe11a16-Nov-09 15:22
bigjoe11a16-Nov-09 15:22 

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.