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

C#

 
GeneralRe: Incorrect syntax near keyword 'DEFAULT' Pin
Mark T Garcia25-Feb-05 13:30
Mark T Garcia25-Feb-05 13:30 
GeneralWindows Form and Message Box Pin
MarkMokris25-Feb-05 7:51
MarkMokris25-Feb-05 7:51 
GeneralRe: Windows Form and Message Box Pin
Peter Nirschl25-Feb-05 9:31
Peter Nirschl25-Feb-05 9:31 
GeneralRe: Windows Form and Message Box Pin
DougW4825-Feb-05 14:04
DougW4825-Feb-05 14:04 
GeneralRe: Windows Form and Message Box Pin
leppie25-Feb-05 19:24
leppie25-Feb-05 19:24 
GeneralXmlValidingReader getting started Pin
Kenny O'Dell25-Feb-05 7:50
Kenny O'Dell25-Feb-05 7:50 
GeneralRe: XmlValidingReader getting started Pin
Kenny O'Dell25-Feb-05 7:53
Kenny O'Dell25-Feb-05 7:53 
GeneralRe: XmlValidingReader getting started Pin
Radgar25-Feb-05 8:10
Radgar25-Feb-05 8:10 
Use XmlDocument instead. Better performance for especially short XML files.

Here is an example:

<br />
private void Insert2XML(string strXmlFilePath, string PersonName, int ID, string Notes)<br />
{<br />
XmlDocument doc = new XmlDocument();<br />
doc.Load(strXmlFilePath);<br />
XmlNode root = doc.DocumentElement;<br />
<br />
XmlNode Person = doc.CreateElement("Person");<br />
Person.SetAttribute("Name", PersonName);<br />
Person.SetAttribute("ID", ID.ToString());<br />
Person.InnerText = Notes;<br />
root.AppendChild(Person);<br />
<br />
// Save the document to a file and auto-indent the output.<br />
XmlTextWriter writer = new XmlTextWriter(strXmlFilePath, null);<br />
writer.Formatting = Formatting.Indented;<br />
writer.Indentation = 4;<br />
doc.Save(writer);<br />
writer.Close();<br />
}<br />
<br />
private string GetPersonID(string strXmlFilePath, string PersonName)<br />
{<br />
XmlDocument doc = new XmlDocument();<br />
doc.Load(strXmlFilePath);<br />
XmlNode root = doc.DocumentElement;<br />
<br />
XmlNode SearchNode = root.SelectSingleNode("//*[@Name='" + PersonName + "']");<br />
if (SearchNode != null)<br />
{<br />
return SearchNode.Attributes["ID"].Value;<br />
}<br />
else<br />
{return "Not Found!"}<br />
}<br />


Radgar
"Imagination is more important than knowledge." - Albert Einstein
GeneralTextBox context menu Pin
MitchellBaldwin25-Feb-05 7:43
MitchellBaldwin25-Feb-05 7:43 
GeneralRe: TextBox context menu Pin
Radgar25-Feb-05 7:50
Radgar25-Feb-05 7:50 
GeneralRe: TextBox context menu Pin
MitchellBaldwin25-Feb-05 8:57
MitchellBaldwin25-Feb-05 8:57 
GeneralUNKNOWN PROBLEM (ListBox DataSource ) Pin
Radgar25-Feb-05 7:31
Radgar25-Feb-05 7:31 
GeneralRe: ListBox DataSource PROBLEM Pin
Dave Kreskowiak25-Feb-05 7:55
mveDave Kreskowiak25-Feb-05 7:55 
GeneralRe: ListBox DataSource PROBLEM Pin
Radgar25-Feb-05 8:12
Radgar25-Feb-05 8:12 
GeneralRedirectFromLogin Page help Pin
cmitty25-Feb-05 5:55
cmitty25-Feb-05 5:55 
GeneralRe: RedirectFromLogin Page help Pin
Heath Stewart25-Feb-05 6:29
protectorHeath Stewart25-Feb-05 6:29 
GeneralRe: RedirectFromLogin Page help Pin
GaMBiT_KC26-Feb-05 1:07
GaMBiT_KC26-Feb-05 1:07 
GeneralRe: RedirectFromLogin Page help Pin
Anonymous27-Feb-05 22:27
Anonymous27-Feb-05 22:27 
Generalrun desktop application on webpage Pin
Member 148149125-Feb-05 5:06
Member 148149125-Feb-05 5:06 
GeneralRe: run desktop application on webpage Pin
Heath Stewart25-Feb-05 5:22
protectorHeath Stewart25-Feb-05 5:22 
GeneralMessageBox shows no text Pin
Sailer0125-Feb-05 5:01
sussSailer0125-Feb-05 5:01 
GeneralRe: MessageBox shows no text Pin
Heath Stewart25-Feb-05 6:40
protectorHeath Stewart25-Feb-05 6:40 
GeneralRe: MessageBox shows no text Pin
GaMBiT_KC26-Feb-05 1:00
GaMBiT_KC26-Feb-05 1:00 
GeneralC# and Custom C++ interfaces Pin
vad_kr25-Feb-05 3:40
vad_kr25-Feb-05 3:40 
GeneralRe: C# and Custom C++ interfaces Pin
Heath Stewart25-Feb-05 6:14
protectorHeath Stewart25-Feb-05 6:14 

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.