locked
ds.WriteXml change predifined NewDataSet (name) and Table (name) to something custum RRS feed

  • Question

  • User1444011213 posted

    Hi, 

    I have written a script in VB that takes date from sql query and stores it in xml file, but I need to change default names of main threat

    This is what I am currently get as an resoult:

    <?xml version="1.0" standalone="yes"?>
      <NewDataSet>
        <Table>
          <Code>2581</Code>
          <Name>Name1</Name>
          <Price>58.85</Price>
        </Table>
        <Table>
          <Code>2607</Code>
          <Name>Name2</Name>
          <Price>452.44</Price>
        </Table>
    </NewDataSet>

    I need to change this:

    <Table></Table> to say <kolona></kolona>

    <NewDataSet></NewDataSet> to say <pocetak></pocetak>

    so the end resolut should be:

    <?xml version="1.0" standalone="yes"?>
      <pocetak>
        <kolona>
          <Code>2581</Code>
          <Name>Name1</Name>
          <Price>58.85</Price>
        </kolona>
        <kolona>
          <Code>2607</Code>
          <Name>Name2</Name>
          <Price>452.44</Price>
        </kolona>
    </pocetak>

    I am using this command:

    adapter = New SqlDataAdapter(selectSQL, connectionString)
    adapter.Fill(ds)
    ds.WriteXml(Path.Combine(Request.PhysicalApplicationPath, "\test.xml"), Data.XmlWriteMode.IgnoreSchema)

    Thanks for any help

    Saturday, July 23, 2016 11:06 AM

Answers

All replies