Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
QuestionUpdating data in Form A from form B? Pin
Johan Glysing6-Sep-05 20:17
Johan Glysing6-Sep-05 20:17 
AnswerRe: Updating data in Form A from form B? Pin
Gavin Jeffrey6-Sep-05 22:21
Gavin Jeffrey6-Sep-05 22:21 
GeneralRe: Updating data in Form A from form B? Pin
Johan Glysing6-Sep-05 22:40
Johan Glysing6-Sep-05 22:40 
GeneralRe: Updating data in Form A from form B? Pin
Ashok Dhamija6-Sep-05 23:26
Ashok Dhamija6-Sep-05 23:26 
QuestionDataReader Issue Pin
Expert Coming6-Sep-05 18:42
Expert Coming6-Sep-05 18:42 
AnswerRe: DataReader Issue Pin
Gavin Jeffrey6-Sep-05 22:34
Gavin Jeffrey6-Sep-05 22:34 
AnswerRe: DataReader Issue Pin
Guffa6-Sep-05 23:49
Guffa6-Sep-05 23:49 
QuestionTry... Catch.... help Pin
sonicsqwirl6-Sep-05 18:28
sonicsqwirl6-Sep-05 18:28 
I have a loop that is inside a Try Catch handler. It is 2 nested WHILE loops... the outer loop connects to a list of servers, and the inner loop, is a list of services to check on those servers. When I try to check for a service that isn't on the server, it goes to the Catch statement (which is good) and handles the exception (also good), except it skips to the next server instead of checking the rest of the services on that server. Is there a way to tell the Catch statement to go back to where it left off in the inner loop?

			string server = null;<br />
			try<br />
			{<br />
				while ((server = rSrv.ReadLine()) != null)<br />
				{<br />
					try<br />
					{<br />
						sw = new StreamWriter("Server_SvcLog.txt", true);<br />
<br />
						string header1 = "";<br />
						string header2 = "******************** " + DateTime.Now + spc + server + " ********************";<br />
						sw.WriteLine(header1);<br />
						Running_Event(header1);<br />
						sw.WriteLine(header2);<br />
						Running_Event(header2);<br />
							<br />
						StreamReader rSvc = File.OpenText(svcPath);<br />
						string service = null;<br />
						//serviceFound = false;<br />
						while ((service = rSvc.ReadLine()) != null)<br />
						{<br />
							ServiceController sc = new ServiceController(service, server);<br />
							if(sc.Status.ToString() != "Running")<br />
							{<br />
								event_message = "NOT_RUNNING_EVENT" + spc + DateTime.Now + spc + server + spc + sc.DisplayName + spc + " is " + sc.Status.ToString();<br />
								Not_Running_Event(event_message);<br />
							}<br />
							else if(sc.Status.ToString() == "Running")<br />
							{<br />
								event_message = "RUNNING_EVENT" + spc + DateTime.Now + spc + server + spc + sc.DisplayName + spc + " is " + sc.Status.ToString();<br />
								Running_Event(event_message);<br />
							}<br />
							else<br />
							{<br />
								event_message = "SERVICE_NOT_FOUND" + spc + DateTime.Now + spc + sc.DisplayName + " not found on " + server;<br />
								Service_Not_Found_Event(event_message);<br />
							}	<br />
				<br />
						}<br />
					}<br />
					catch(Exception ex)<br />
					{<br />
						SvcError(ex.Message);<br />
								<br />
					}<br />
					finally<br />
					{<br />
						if(sw!=null)<br />
							sw.Close();<br />
<br />
					}<br />
					<br />
				}<br />
				<br />
			}<br />
			catch(Exception ex)<br />
			{<br />
				LogError(ex.Message);<br />
			}<br />
			rSrv.Close();<br />
			<br />
		}

AnswerRe: Try... Catch.... help Pin
Expert Coming6-Sep-05 18:43
Expert Coming6-Sep-05 18:43 
AnswerRe: Try... Catch.... help Pin
Christian Graus6-Sep-05 18:46
protectorChristian Graus6-Sep-05 18:46 
GeneralRe: Try... Catch.... help Pin
Expert Coming6-Sep-05 19:00
Expert Coming6-Sep-05 19:00 
AnswerRe: Try... Catch.... help Pin
S. Senthil Kumar6-Sep-05 19:12
S. Senthil Kumar6-Sep-05 19:12 
Question.net reporting addin Pin
bwagz6-Sep-05 18:08
bwagz6-Sep-05 18:08 
QuestionI can't Create File in the dir that FileSystemWatch monitor by using FileStream Pin
6-Sep-05 17:47
suss6-Sep-05 17:47 
AnswerRe: I can't Create File in the dir that FileSystemWatch monitor by using FileStream Pin
Dave Kreskowiak8-Sep-05 1:40
mveDave Kreskowiak8-Sep-05 1:40 
QuestionChange Parent form from Dialog Box Pin
bootn6-Sep-05 17:11
bootn6-Sep-05 17:11 
AnswerRe: Change Parent form from Dialog Box Pin
Christian Graus6-Sep-05 17:29
protectorChristian Graus6-Sep-05 17:29 
QuestionMemory Management Pin
VickyC#6-Sep-05 15:08
VickyC#6-Sep-05 15:08 
AnswerRe: Memory Management Pin
Matt Gerrans6-Sep-05 15:30
Matt Gerrans6-Sep-05 15:30 
GeneralRe: Memory Management Pin
VickyC#6-Sep-05 16:02
VickyC#6-Sep-05 16:02 
GeneralRe: Memory Management Pin
Dave Kreskowiak6-Sep-05 16:18
mveDave Kreskowiak6-Sep-05 16:18 
GeneralRe: Memory Management Pin
VickyC#6-Sep-05 16:33
VickyC#6-Sep-05 16:33 
GeneralRe: Memory Management Pin
Matt Gerrans6-Sep-05 20:00
Matt Gerrans6-Sep-05 20:00 
GeneralRe: Memory Management Pin
Luis Alonso Ramos6-Sep-05 16:55
Luis Alonso Ramos6-Sep-05 16:55 
AnswerRe: Memory Management Pin
Christian Graus6-Sep-05 16:56
protectorChristian Graus6-Sep-05 16:56 

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.