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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Exporting Class Data To XML

Exporting Class Data To XML

Scheduled Pinned Locked Moved C#
xmlhelpquestion
8 Posts 4 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.
  • K Offline
    K Offline
    Kais4U
    wrote on last edited by
    #1

    Hi, I have created a class object and populated it with the data. Now i want to export the data into a XML format. Is there any direct way of exporting the object data to XML? if yes, can you provide me with the code snippet?? Thanks in advance for any suggestions and help Regards, Kais

    T S 2 Replies Last reply
    0
    • K Kais4U

      Hi, I have created a class object and populated it with the data. Now i want to export the data into a XML format. Is there any direct way of exporting the object data to XML? if yes, can you provide me with the code snippet?? Thanks in advance for any suggestions and help Regards, Kais

      T Offline
      T Offline
      Tamimi Code
      wrote on last edited by
      #2

      hi read this article http://www.ondotnet.com/pub/a/dotnet/2004/01/26/serializationpt1.html[^] Tamimi - Code

      K 1 Reply Last reply
      0
      • K Kais4U

        Hi, I have created a class object and populated it with the data. Now i want to export the data into a XML format. Is there any direct way of exporting the object data to XML? if yes, can you provide me with the code snippet?? Thanks in advance for any suggestions and help Regards, Kais

        S Offline
        S Offline
        sathish s
        wrote on last edited by
        #3

        There is no inbuilt way to do this.. HTH http://www.codeproject.com/soap/XmlToClassAndBack.asp[^] -- modified at 7:54 Tuesday 20th June, 2006

        J 1 Reply Last reply
        0
        • T Tamimi Code

          hi read this article http://www.ondotnet.com/pub/a/dotnet/2004/01/26/serializationpt1.html[^] Tamimi - Code

          K Offline
          K Offline
          Kais4U
          wrote on last edited by
          #4

          Hi Tamimi, Well the topic helped me. Now if i have an array of class object, will the same logic work? Say for example i have a Cat Class. I create an array of the cat class and populate with data. Now i want to export that cat class array to xml Regards Kais

          T 1 Reply Last reply
          0
          • K Kais4U

            Hi Tamimi, Well the topic helped me. Now if i have an array of class object, will the same logic work? Say for example i have a Cat Class. I create an array of the cat class and populate with data. Now i want to export that cat class array to xml Regards Kais

            T Offline
            T Offline
            Tamimi Code
            wrote on last edited by
            #5

            i think it will work !! you will create several xml files according to your array Tamimi - Code

            1 Reply Last reply
            0
            • S sathish s

              There is no inbuilt way to do this.. HTH http://www.codeproject.com/soap/XmlToClassAndBack.asp[^] -- modified at 7:54 Tuesday 20th June, 2006

              J Offline
              J Offline
              J4amieC
              wrote on last edited by
              #6

              sathish s wrote:

              There is no inbuilt way to do this..

              Yes there is, the article you linked to uses an XmlSerializer, which is "built-in" or at least comes with the framework! Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour

              S 1 Reply Last reply
              0
              • J J4amieC

                sathish s wrote:

                There is no inbuilt way to do this..

                Yes there is, the article you linked to uses an XmlSerializer, which is "built-in" or at least comes with the framework! Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour

                S Offline
                S Offline
                sathish s
                wrote on last edited by
                #7

                J4amieC wrote:

                at least comes with the framework!

                I agree with that, But I suppose something like dataSet.ReadXml(), DataSet.WriteXml were Inbuilt Methods.

                K 1 Reply Last reply
                0
                • S sathish s

                  J4amieC wrote:

                  at least comes with the framework!

                  I agree with that, But I suppose something like dataSet.ReadXml(), DataSet.WriteXml were Inbuilt Methods.

                  K Offline
                  K Offline
                  Kais4U
                  wrote on last edited by
                  #8

                  Yes satish, Dataset has this kind of build in methods. Am looking at similar methods for custom classes. Well one alternative is using of XMLSerialization as disussed before Regards Kais

                  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