Results 1 to 3 of 3

Thread: nodes in XML

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    26

    nodes in XML

    Code:
     XmlDocument doc = new XmlDocument();
               doc.Load("contor.xml");
               XmlNodeList items = doc.SelectNodes(@"Aparate/Aparat/Pozitii/Pozitie");
               foreach (XmlNode node in items)
               {
                   if (node.LocalName == "Pozitie")
                   {
    
                      DataRow dr = dp.NewRow();
                       dr["Produs"] = node.ChildNodes[0].InnerXml;
                       dr["ContorInitial"] = node.ChildNodes[1].InnerXml;
                       dr["ContorFinal"] = node.ChildNodes[2].InnerXml;
                       dp.Rows.Add(dr);
    
                   }
               }
    i have a DataSet Dset and a DataTable dp
    how i put in Dataset the data from DataTable?

    now i want to put
    Last edited by King Abadon; May 16th, 2007 at 05:24 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: nodes in XML

    Please use code tags to make your post more readable.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Hyperactive Member drattansingh's Avatar
    Join Date
    Sep 2005
    Posts
    395

    Re: nodes in XML

    Ok. For things like these i like to take it slow. So first I would extract the data from the xml document and probably print it out to a text box just to make sure that I am getting the data. Second, I would create a table and enter some hard coded values in that table just to make sure that I am entering it the correct way. Finally that last step I would do is to actually add the data that goes from the xml to the text box to the table.

    I don't know if this will help you, there seems to be an error, the question is where is that error. When I take things in small steps, if I find an error, I usually also find out where that error is located.

    Jennifer.

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