Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. XML [modified]

XML [modified]

Scheduled Pinned Locked Moved ASP.NET
csharpxmlquestioncareer
9 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Farraj
    wrote on last edited by
    #1

    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? thanks

    modified on Friday, April 9, 2010 12:43 PM

    B S A F 4 Replies Last reply
    0
    • F Farraj

      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? thanks

      modified on Friday, April 9, 2010 12:43 PM

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      So what is the problem?You can create the xml in C# very easily.Did you try something? for samples have a look to the following links -Link 1 -Link 2

      Cheers!! Brij Check my latest Article :Exploring ASP.NET Validators

      1 Reply Last reply
      0
      • F Farraj

        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? thanks

        modified on Friday, April 9, 2010 12:43 PM

        S Offline
        S Offline
        Sandesh M Patil
        wrote on last edited by
        #3

        You have to use XMLTextwriter for creating a Xml file.See below link for help XMLTextwriter

        1 Reply Last reply
        0
        • F Farraj

          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? thanks

          modified on Friday, April 9, 2010 12:43 PM

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          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 and XmlTextWriterClass to write the XML Object in the file.

          Cheers ! Abhijit My Blog : http://abhijitjana.net

          1 Reply Last reply
          0
          • F Farraj

            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? thanks

            modified on Friday, April 9, 2010 12:43 PM

            F Offline
            F Offline
            Farraj
            wrote on last edited by
            #5

            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>

            N 1 Reply Last reply
            0
            • F Farraj

              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>

              N Offline
              N Offline
              Not Active
              wrote on last edited by
              #6

              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

              F 1 Reply Last reply
              0
              • N Not Active

                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

                F Offline
                F Offline
                Farraj
                wrote on last edited by
                #7

                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 :)

                N L 2 Replies Last reply
                0
                • F Farraj

                  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 :)

                  N Offline
                  N Offline
                  Not Active
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  • F Farraj

                    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 :)

                    L Offline
                    L Offline
                    leckey 0
                    wrote on last edited by
                    #9

                    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/[^]

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups