XML [modified]
-
hi im trying to build a form that enters data from textboxes into my xml file i need to get to this :
<chores> <day label="A" > <job price="30" product="bla bla" size="20x33" amount="22"/> <job price="30" product="bla bla" size="20x33" amount="22"/> <job price="30" product="bla bla" size="20x33" amount="22"/> </day> </chores>
can anyone please tell me what should i exactly write in my C# code to get this working? thanksmodified on Friday, April 9, 2010 12:43 PM
-
hi im trying to build a form that enters data from textboxes into my xml file i need to get to this :
<chores> <day label="A" > <job price="30" product="bla bla" size="20x33" amount="22"/> <job price="30" product="bla bla" size="20x33" amount="22"/> <job price="30" product="bla bla" size="20x33" amount="22"/> </day> </chores>
can anyone please tell me what should i exactly write in my C# code to get this working? thanksmodified on Friday, April 9, 2010 12:43 PM
-
hi im trying to build a form that enters data from textboxes into my xml file i need to get to this :
<chores> <day label="A" > <job price="30" product="bla bla" size="20x33" amount="22"/> <job price="30" product="bla bla" size="20x33" amount="22"/> <job price="30" product="bla bla" size="20x33" amount="22"/> </day> </chores>
can anyone please tell me what should i exactly write in my C# code to get this working? thanksmodified on Friday, April 9, 2010 12:43 PM
You have to use XMLTextwriter for creating a Xml file.See below link for help XMLTextwriter
-
hi im trying to build a form that enters data from textboxes into my xml file i need to get to this :
<chores> <day label="A" > <job price="30" product="bla bla" size="20x33" amount="22"/> <job price="30" product="bla bla" size="20x33" amount="22"/> <job price="30" product="bla bla" size="20x33" amount="22"/> </day> </chores>
can anyone please tell me what should i exactly write in my C# code to get this working? thanksmodified on Friday, April 9, 2010 12:43 PM
First if all your question has nothing to do with ASP.NET. This is normal C# code, where you need to use
System.Xml
namespace andXmlTextWriter
Class to write the XML Object in the file.Cheers ! Abhijit My Blog : http://abhijitjana.net
-
hi im trying to build a form that enters data from textboxes into my xml file i need to get to this :
<chores> <day label="A" > <job price="30" product="bla bla" size="20x33" amount="22"/> <job price="30" product="bla bla" size="20x33" amount="22"/> <job price="30" product="bla bla" size="20x33" amount="22"/> </day> </chores>
can anyone please tell me what should i exactly write in my C# code to get this working? thanksmodified on Friday, April 9, 2010 12:43 PM
i did try something that is working mlDocument doc = new XmlDocument(); doc.Load("chores2.xml"); XmlElement elmXML = doc.CreateElement("day"); string strNewCat = "<a>" + this.txtBoxAmount.Text + "</a>" + "<b>" + this.txtBoxPrice.Text +"</b>" + "<c>" + this.txtBoxAbout.Text + "</c>" + "<d>" + this.txtBoxSize.Text + "</d>"; elmXML.InnerXml = strNewCat; doc.DocumentElement.AppendChild(elmXML); doc.Save(Server.MapPath("chores.xml")); but it build the xml file not as i need it to be my question was how can i build it this way <day label=XXX> <job a="1" b="2"../> <job a="2" b=3".../> </day> <day label=XXX> <job a="1" b="2"../> <job a="2" b=3".../> </day>
-
i did try something that is working mlDocument doc = new XmlDocument(); doc.Load("chores2.xml"); XmlElement elmXML = doc.CreateElement("day"); string strNewCat = "<a>" + this.txtBoxAmount.Text + "</a>" + "<b>" + this.txtBoxPrice.Text +"</b>" + "<c>" + this.txtBoxAbout.Text + "</c>" + "<d>" + this.txtBoxSize.Text + "</d>"; elmXML.InnerXml = strNewCat; doc.DocumentElement.AppendChild(elmXML); doc.Save(Server.MapPath("chores.xml")); but it build the xml file not as i need it to be my question was how can i build it this way <day label=XXX> <job a="1" b="2"../> <job a="2" b=3".../> </day> <day label=XXX> <job a="1" b="2"../> <job a="2" b=3".../> </day>
If you are going to post code, please learn to format it. Look at the code block or inline code items above the textarea you used to write your post.
I know the language. I've read a book. - _Madmatt
-
If you are going to post code, please learn to format it. Look at the code block or inline code items above the textarea you used to write your post.
I know the language. I've read a book. - _Madmatt
-
does it really bother you..? i asked for someone to help me with my code not to teach me how to format my code cuz i know how :)
don-basil wrote:
not to teach me how to format my code cuz i know how
Apparently you do not. http://www.codeproject.com/Messages/1278599/How-to-get-an-answer-to-your-question.aspx[^] Look at item #7. Check the other rules and learn or you will continue to receive such feedback and risk being ignored or worse, which won't get any of your questions answered.
I know the language. I've read a book. - _Madmatt
-
does it really bother you..? i asked for someone to help me with my code not to teach me how to format my code cuz i know how :)
YES it really bothers us. That's why there are those nifty convienent code block tags for you to use. And responses like this to long-term members will get you noticed, and no one will be willing to help you in the future. Even if it does have a smiley face at the end.
Yeah, I need to update this. Darn Judge Judy reruns! http://CraptasticNation.blogspot.com/[^]