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. General Programming
  3. C#
  4. Database to xml

Database to xml

Scheduled Pinned Locked Moved C#
questiondatabasexmlhelp
6 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.
  • P Offline
    P Offline
    pavya_Cool
    wrote on last edited by
    #1

    hi to all, I want to convert my MS Access databse/table in to an .xml file. How can I do it? help me.

    Pravin

    A 1 Reply Last reply
    0
    • P pavya_Cool

      hi to all, I want to convert my MS Access databse/table in to an .xml file. How can I do it? help me.

      Pravin

      A Offline
      A Offline
      aamironline
      wrote on last edited by
      #2

      Its simple, read data in all the table and generate xml file...

      M Aamir Maniar aamirOnline.com

      P 1 Reply Last reply
      0
      • A aamironline

        Its simple, read data in all the table and generate xml file...

        M Aamir Maniar aamirOnline.com

        P Offline
        P Offline
        pavya_Cool
        wrote on last edited by
        #3

        can u plz send me example for this. I am new to c#.

        Pravin

        B T 2 Replies Last reply
        0
        • P pavya_Cool

          can u plz send me example for this. I am new to c#.

          Pravin

          B Offline
          B Offline
          blackjack2150
          wrote on last edited by
          #4

          You should start with easier tasks if you're new to C#.

          1 Reply Last reply
          0
          • P pavya_Cool

            can u plz send me example for this. I am new to c#.

            Pravin

            T Offline
            T Offline
            T EDY
            wrote on last edited by
            #5

            I use these code to generate a xml file(i use SqlServer2005 for the DB), for example:

            string MyConn = ConfigurationManager.ConnectionStrings["Connect"].ConnectionString; // Connect is my connection name in app config
            SqlConnection conn = new SqlConnection("MyConn");
            string SqlStatement = "SELECT * FROM my_table"
            SqlDataAdapter adapt = new SqlDataAdapter(SqlStatement,conn);
            DataSet ds = new DataSet();
            DataTable dt = new DataTable("my_table");
            adapt.Fill(dt);
            ds.Tables.Add(dt);
            ds.WriteXml (@"..\..\myXmlFile.xml") //create a xml file name myXmlFile
            

            After that build and execute u'r application.In windows explorer,Locate and Find u'r xml file on u'r project folder..Hope Can Help U

            Best Regards, Tomi

            P 1 Reply Last reply
            0
            • T T EDY

              I use these code to generate a xml file(i use SqlServer2005 for the DB), for example:

              string MyConn = ConfigurationManager.ConnectionStrings["Connect"].ConnectionString; // Connect is my connection name in app config
              SqlConnection conn = new SqlConnection("MyConn");
              string SqlStatement = "SELECT * FROM my_table"
              SqlDataAdapter adapt = new SqlDataAdapter(SqlStatement,conn);
              DataSet ds = new DataSet();
              DataTable dt = new DataTable("my_table");
              adapt.Fill(dt);
              ds.Tables.Add(dt);
              ds.WriteXml (@"..\..\myXmlFile.xml") //create a xml file name myXmlFile
              

              After that build and execute u'r application.In windows explorer,Locate and Find u'r xml file on u'r project folder..Hope Can Help U

              Best Regards, Tomi

              P Offline
              P Offline
              pavya_Cool
              wrote on last edited by
              #6

              Thanks Tomi

              Pravin

              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