Click here to Skip to main content
15,889,877 members
Home / Discussions / C#
   

C#

 
QuestionOfficial Receipt Pin
knight_sky6-Feb-06 14:32
knight_sky6-Feb-06 14:32 
AnswerRe: Official Receipt Pin
KevinMac6-Feb-06 18:32
KevinMac6-Feb-06 18:32 
QuestionHow to make documentation for dll? Pin
pmasknguyen6-Feb-06 14:20
pmasknguyen6-Feb-06 14:20 
AnswerRe: How to make documentation for dll? Pin
leppie6-Feb-06 18:11
leppie6-Feb-06 18:11 
AnswerRe: How to make documentation for dll? Pin
jinzhecheng7-Feb-06 9:18
jinzhecheng7-Feb-06 9:18 
QuestionExtract Text from RTF File Pin
emran8346-Feb-06 12:40
emran8346-Feb-06 12:40 
AnswerRe: Extract Text from RTF File Pin
jayvardhanpatil6-Feb-06 18:07
jayvardhanpatil6-Feb-06 18:07 
QuestionLooping XMLNode Pin
dbenisch6-Feb-06 12:07
dbenisch6-Feb-06 12:07 
I am attempting to write a method to iterate through a xml file that has multiple nodes that match a given type but for some reason it only accepts the first one and then exists. I think I may have my loop wrong or something. Can anyone tell me what the issue may be? Confused | :confused:

using System;
using System.IO;
using System.Xml;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Diagnostics;
using System.Threading;

namespace UTS_Batch_Update
{
public class UTSB_Input
{

{
string Path = "C:\\xmlticketID.xml";

// If the user forgets to put in a path, throw a NullException.
if (Path == null)
{
throw new ArgumentNullException();
}


// Load the document.
XmlDocument sourceDoc = new XmlDocument();
sourceDoc.Load(Path);

// Retrieve each ticketID.

//XmlNodeList tickets = sourceDoc.GetElementsByTagName("TicketId");


//Create an XmlNamespaceManager for resolving namespaces.
XmlNamespaceManager nsmgr = new XmlNamespaceManager(sourceDoc.NameTable);

foreach (XmlNode node in tickets)

if (node.Name == "TicketId")
{
//using (MemoryStream buffer = new MemoryStream())
string buffer = "c:\\xmlpost.xml";

XmlTextWriter w = new XmlTextWriter(buffer, null);

// Start the document.
w.WriteStartDocument();
w.WriteStartElement("XMLFILE");
w.WriteAttributeString("UserLogName", "REDMOND\\" + UserInfo);
w.WriteAttributeString("FileId", "MSN Search BUU");
w.WriteAttributeString("Action", "Close");
w.WriteStartElement("TICKET");
w.WriteAttributeString("TicketId", node.InnerXml.ToString());
w.WriteAttributeString("CloseControlInd", "No");
w.WriteAttributeString("ProblemResolved", Resolved);//ConvertBoolToYesNo(Resolved));
w.WriteAttributeString("WereProceduresInPlace", ProceduresInPlace);
w.WriteAttributeString("WereProceduresInPlaceNotes", ProceduresInPlaceNotes);
w.WriteAttributeString("WereProceduresAccurate", ProceduresAccurate);
w.WriteAttributeString("WereProceduresAccurateNotes", ProceduresAccurateNotes);
w.WriteAttributeString("WereToolsEffective", ToolsEffective);
w.WriteAttributeString("WereToolsEffectiveNotes", ToolsEffectiveNotes);
w.WriteAttributeString("FalseAlarmInd", FalseAlarm);
w.WriteAttributeString("VerifiedBy", VerifiedBy);
w.WriteAttributeString("NotifyAliases", NotifyAliases);
w.WriteAttributeString("ClosureNotes", Closure);
w.WriteEndElement();

// End the document.
w.WriteEndElement();
w.WriteEndDocument();
w.Flush();
w.Close();

XmlTextReader reader = new XmlTextReader(buffer);

XmlDocument outputDoc = new XmlDocument();
outputDoc.Load(reader);

string processpath = "C:\\WINDOWS\\system32\\wscript.exe";
string processargs = "C:\\uts.wsf c:\\xmlpost.xml";
System.Diagnostics.Process.Start(processpath, processargs);
return outputDoc;
}




throw new InvalidOperationException("No XML was converted.");
}

} // end method UTSBFileLoad
}
AnswerRe: Looping XMLNode Pin
Guffa6-Feb-06 12:51
Guffa6-Feb-06 12:51 
QuestionSet Tooltip to Coordinate Area of Form Pin
jgallen236-Feb-06 11:48
jgallen236-Feb-06 11:48 
AnswerRe: Set Tooltip to Coordinate Area of Form Pin
jgallen236-Feb-06 12:06
jgallen236-Feb-06 12:06 
QuestionAny Advise?? Service Messages Pin
Chris Cornelius6-Feb-06 10:54
Chris Cornelius6-Feb-06 10:54 
QuestionDataGridView Control .NET 2.0 Pin
usernamed6-Feb-06 9:29
usernamed6-Feb-06 9:29 
AnswerRe: DataGridView Control .NET 2.0 Pin
hpetriffer6-Feb-06 20:20
hpetriffer6-Feb-06 20:20 
AnswerRe: DataGridView Control .NET 2.0 Pin
albCode6-Feb-06 21:08
albCode6-Feb-06 21:08 
QuestionThread-safe Access to Form Controls Pin
LighthouseJ6-Feb-06 8:51
LighthouseJ6-Feb-06 8:51 
AnswerRe: Thread-safe Access to Form Controls Pin
Judah Gabriel Himango6-Feb-06 11:23
sponsorJudah Gabriel Himango6-Feb-06 11:23 
GeneralRe: Thread-safe Access to Form Controls Pin
LighthouseJ6-Feb-06 12:21
LighthouseJ6-Feb-06 12:21 
GeneralRe: Thread-safe Access to Form Controls Pin
LighthouseJ6-Feb-06 15:46
LighthouseJ6-Feb-06 15:46 
GeneralRe: Thread-safe Access to Form Controls Pin
Judah Gabriel Himango6-Feb-06 16:09
sponsorJudah Gabriel Himango6-Feb-06 16:09 
GeneralRe: Thread-safe Access to Form Controls Pin
LighthouseJ6-Feb-06 16:44
LighthouseJ6-Feb-06 16:44 
Questionexport text/reports in XLS, HTML, PDF, DBF, XML... format Pin
MihaiChioariu6-Feb-06 8:23
MihaiChioariu6-Feb-06 8:23 
Questionweather report service Pin
balkang6-Feb-06 8:09
balkang6-Feb-06 8:09 
AnswerRe: weather report service Pin
usernamed6-Feb-06 9:38
usernamed6-Feb-06 9:38 
QuestionDrawLine question Pin
QzRz6-Feb-06 7:23
QzRz6-Feb-06 7:23 

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.