Problem writing to an XML file

Discussion in 'MCAD' started by cashdeskmac, Sep 18, 2004.

  1. cashdeskmac

    cashdeskmac Guest

    I have added an XML file to my project and set it up like so:

    <rotas xmlns = "http:\\ etc..">
    <Managers>
    <manager ID = "1" FirstName = "Bill" LastName = "Gates"<\manager>
    <\Managers>
    <\rotas>

    Now, when I add a new manager row to this table called Managers, it doesn't
    appear between the <Managers> tags, but instead it appears just below it. I
    then have difficulty in deleting a new file as it can't be found, probably
    due to this error.

    The syntax I am using to add a new manager row is:

    DataRow row = rotas1.manager.NewRow();
    string [] ar = new string [3] {txtID.Text, txtFirstName.Text,
    txtLastName.Text};

    for(int i = o; i<ar.Length; i++)
    {
    row = ar;
    }
    rotas1.manager.Rows.Add(row);
    rotas1.WriteXml("..\\..\\XMLFile1.xml");

    Can anyone please point me in the right direction.
     
    cashdeskmac, Sep 18, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom Denford

    How to convert XML file to OPML File ...

    Tom Denford, Apr 24, 2005, in forum: Computer Support
    Replies:
    1
    Views:
    12,857
  2. datta.saru
    Replies:
    0
    Views:
    1,499
    datta.saru
    May 15, 2006
  3. sovan
    Replies:
    0
    Views:
    1,244
    sovan
    Jul 25, 2006
  4. Replies:
    1
    Views:
    443
  5. femi
    Replies:
    3
    Views:
    5,200
    VanguardLH
    Sep 25, 2007
Loading...

Share This Page