Results 1 to 4 of 4

Thread: [2008] DataSet.ReadXML question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Location
    Manchester, England
    Posts
    255

    [2008] DataSet.ReadXML question

    Hi,
    As a relative newcomer to XML, I wonder if somebody could confirm my suspicions.
    If I have a DataSet created in the designer, containing one table, am I right in thinking that to add records to the table, I would need to iterate through my DataSet.ReadXML, and populate the designer dataset one record at a time?
    At home - VB.NET 2005/2008 Express, Visual Web Developer 2005 Express
    At work - VS 2008 Standard (VB)
    .NET 2.0/3.5


    Visual Studio Express Learning Centre | How do I videos | MSDN VB Express Forum | MSDN VB Developer Centre

  2. #2
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: [2008] DataSet.ReadXML question

    nope,You can directly add new Record to you datatble object by using DataRow Object.
    e.g
    Code:
    dim drNew as DataRow
    
    drNew = dtMyTable.NewRow
    
    drNew.Item(0) = "Value"
    
    dtMyTable.Rows.Add(drNew)
    the above code will add new record to your datatable.

    Ps: I Hope i got you question right.
    __________________
    Rate the posts that helped you

  3. #3
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [2008] DataSet.ReadXML question

    The DataSet.ReadXml method will read the whole contents of the xml file into the dataset.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Location
    Manchester, England
    Posts
    255

    Re: [2008] DataSet.ReadXML question

    Thanks for your replies.
    The designed DataSet is in place due to the requirements of the ReportViewer. I simply wanted to read my XML file, and stuff it into the designed DataSet.DataTable.
    I had wanted to do a simple ReadXML, but because this reads everything all in one go, I was thinking that I'd have to set up an XML reader to read one record in at a time.
    At home - VB.NET 2005/2008 Express, Visual Web Developer 2005 Express
    At work - VS 2008 Standard (VB)
    .NET 2.0/3.5


    Visual Studio Express Learning Centre | How do I videos | MSDN VB Express Forum | MSDN VB Developer Centre

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