Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

RivasBoy

@RivasBoy
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Create XML file with C#
    R RivasBoy

    I developed an application in C # where I have 4 text boxes and a datagrid with 4 columns and multiple rows and a button.

    The button should generate an xml file.

    I can create the xml file and write the data from text boxes, but not the DataGrid.

    Anyone can help me?

    At this moment i have this code: In the button action XmlTextWriter writer = new XmlTextWriter("teste.xml", Encoding.GetEncoding("ISO-8859-1")); Writer.Formatting = Formatting.Indented; // for the textboxes: WriteStartElement("textbox1"); WriteElementString(textbox1.text); WriteEndElement(); WriteStartElement("textbox2"); WriteElementString(textbox2.text); WriteEndElement(); WriteStartElement("textbox3"); WriteElementString(textbox3.text); WriteEndElement(); WriteStartElement("textbox4"); WriteElementString(textbox4.text); WriteEndElement(); WriteStartElement("textbox4"); WriteElementString(textbox4.text); WriteEndElement(); For the datadridview xml output strutured shoud be like this:

    <Tabela>
    <Tabela-Linha numero="1">
    <Id>01</id>
    <Nome>Teste1</Nome>
    <Cargo>xxx</Cargo>
    <Extensao>500</Extensao>
    </Tabela-Linha>
    <Tabela-Linha numero="2">
    <Id>02</id>
    <Nome>teste2</Nome>
    <Cargo>xxxx</Cargo>
    <Extensao>501</Extensao>
    </Tabela-Linha>
    </Tabela>

    Can anyone help me?

    C# csharp xml help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups