Results 1 to 6 of 6

Thread: best way to get xml into a dataset...

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    best way to get xml into a dataset...

    Hi all, just wondering if what i've been doing for the last few months is the best method to get data from xml and onto datatables within a dataset or if there is a simpler way i have completely overlooked. Rather than go into the code i will explain the process step by step.

    1/ setup a dataset and add tables with columns ready for data
    2/ setup various classes so i can construct a list (or array) of a specific type
    3/ get the xml into an XElement type.
    4/ use LINQ to obtain a query from the xml
    5/ use this query to create lines of the type we setup in step 2/
    6/ use these lines to create a datarow and add to the relevent table.
    7/ bind the table to a dgv to show the table.

    Now i am wondering if i can say for the type in step 2/ use DataRow as the type thus missing out step 5/ ? is this possible? what other ways are there to get xml into a DataSet? One other method that occurs to me is to load the xml directly into the datatable (this is possible?) but i am not sure what the xml needs to look like for that to work. My xml is simple it contains only values and no parameters if that helps...

    I require my final dgv to be sortable by column clicks etc so needs to comply to various interfaces, any pointers on this (perhaps i can avoid using a dataset and populate direct from my DataObjects so i only need steps 2, 3, 4, 5 and 7?)
    Last edited by Megalith; Apr 21st, 2010 at 04:30 AM.
    If debugging is the process of removing bugs, then programming must be the process of putting them in.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width