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. XML string to DataTable

XML string to DataTable

Scheduled Pinned Locked Moved C#
xmldatabasetestingbeta-testinghelp
1 Posts 1 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.
  • L Offline
    L Offline
    lsugirljte
    wrote on last edited by
    #1

    Hi, I'm trying to do something that seems pretty easy. I have a xml string that I want in a datatable. After some testing, I think the biggest problem is getting the schema into a new datatable from a xml string. public void XMLStringToDataTable(string as_xml, ref DataTable adt_working) { if (adt_working == null) adt_working = new DataTable(); StringReader lstr_temp = new StringReader(as_xml); XmlTextReader lxmlReader = new XmlTextReader(lstr_temp); adt_working.ReadXmlSchema(lxmlReader); adt_working.ReadXml(lxmlReader); adt_working.AcceptChanges(); } Is there any easier/ better way to do this? One that works? I would like to use a datatable instead of a dataset if possible. sample xml string: 62291905/4/2006 00:00:002test5/4/2006 00:00:00N16471678 Thanks, Jessica

    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