Click here to Skip to main content
15,890,579 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to work on BNC POS Printer Pin
CoderForEver25-Feb-10 8:46
CoderForEver25-Feb-10 8:46 
Questionrunning a window without installing Pin
Wamuti14-Feb-10 7:16
Wamuti14-Feb-10 7:16 
AnswerRe: running a window without installing Pin
Luc Pattyn14-Feb-10 7:33
sitebuilderLuc Pattyn14-Feb-10 7:33 
GeneralRe: running a window without installing Pin
Wamuti14-Feb-10 7:40
Wamuti14-Feb-10 7:40 
QuestionXml database Pin
antrock10114-Feb-10 6:48
antrock10114-Feb-10 6:48 
JokeRe: Xml database Pin
Dan Mos14-Feb-10 7:12
Dan Mos14-Feb-10 7:12 
GeneralRe: Xml database Pin
antrock10114-Feb-10 7:14
antrock10114-Feb-10 7:14 
AnswerRe: Xml database Pin
Dan Mos14-Feb-10 7:23
Dan Mos14-Feb-10 7:23 
antrock101 wrote:
private void button1_Click(object sender, EventArgs e)
{
string sStartupPath = Application.StartupPath;
XmlTextWriter objXmlTextWriter = new XmlTextWriter(sStartupPath + @"\\xmldata.xml", null);
objXmlTextWriter.Formatting = Formatting.Indented;
objXmlTextWriter.WriteStartDocument();
objXmlTextWriter.WriteStartElement(ID);
objXmlTextWriter.WriteString(textBox1.Text);
objXmlTextWriter.WriteEndElement();
objXmlTextWriter.WriteEndDocument();
objXmlTextWriter.Flush();
objXmlTextWriter.Close();
}


well that is because each time you click the button1 you create a new xmlFile, you write the
start document and everything.

you're not adding to the existing one but creating a new one.

Also, try using XDocument it rocks your DOM world at least it did for me.
GeneralRe: Xml database Pin
antrock10114-Feb-10 7:26
antrock10114-Feb-10 7:26 
GeneralRe: Xml database Pin
Dan Mos14-Feb-10 7:40
Dan Mos14-Feb-10 7:40 
GeneralRe: Xml database Pin
antrock10114-Feb-10 7:50
antrock10114-Feb-10 7:50 
GeneralRe: Xml database Pin
Dan Mos14-Feb-10 7:58
Dan Mos14-Feb-10 7:58 
GeneralRe: Xml database Pin
Not Active14-Feb-10 9:23
mentorNot Active14-Feb-10 9:23 
AnswerRe: Xml database Pin
Keith Barrow14-Feb-10 9:58
professionalKeith Barrow14-Feb-10 9:58 
GeneralRe: Xml database Pin
antrock10114-Feb-10 10:00
antrock10114-Feb-10 10:00 
GeneralRe: Xml database Pin
Keith Barrow14-Feb-10 10:09
professionalKeith Barrow14-Feb-10 10:09 
GeneralRe: Xml database Pin
antrock10114-Feb-10 11:39
antrock10114-Feb-10 11:39 
Questionusing webcam Pin
naghoumeh1414-Feb-10 6:26
naghoumeh1414-Feb-10 6:26 
Questionuse only 2 digis in simple precision Pin
naghoumeh1414-Feb-10 6:21
naghoumeh1414-Feb-10 6:21 
AnswerRe: use only 2 digis in simple precision Pin
Dan Mos14-Feb-10 6:36
Dan Mos14-Feb-10 6:36 
GeneralRe: use only 2 digis in simple precision Pin
Luc Pattyn14-Feb-10 6:59
sitebuilderLuc Pattyn14-Feb-10 6:59 
GeneralRe: use only 2 digis in simple precision Pin
Dan Mos14-Feb-10 7:05
Dan Mos14-Feb-10 7:05 
QuestionC# application and Facebook integration Pin
Etienne_12314-Feb-10 5:15
Etienne_12314-Feb-10 5:15 
AnswerRe: C# application and Facebook integration Pin
Abhinav S14-Feb-10 5:19
Abhinav S14-Feb-10 5:19 
QuestionMessage Removed Pin
14-Feb-10 4:49
hassan iravani14-Feb-10 4:49 

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.