Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to retrieve a single value from datatable Pin
mschotamaster22-Jan-12 3:48
mschotamaster22-Jan-12 3:48 
GeneralRe: how to retrieve a single value from datatable Pin
Eddy Vluggen22-Jan-12 3:49
professionalEddy Vluggen22-Jan-12 3:49 
AnswerRe: how to retrieve a single value from datatable Pin
Luc Pattyn22-Jan-12 4:05
sitebuilderLuc Pattyn22-Jan-12 4:05 
GeneralRe: how to retrieve a single value from datatable Pin
Richard MacCutchan22-Jan-12 5:06
mveRichard MacCutchan22-Jan-12 5:06 
Questionhow made a factor i c# Pin
Alireza_Nasr21-Jan-12 7:49
Alireza_Nasr21-Jan-12 7:49 
AnswerRe: how made a factor i c# Pin
Dave Kreskowiak21-Jan-12 14:11
mveDave Kreskowiak21-Jan-12 14:11 
AnswerRe: how made a factor i c# Pin
Nathan Stiles23-Jan-12 10:46
Nathan Stiles23-Jan-12 10:46 
QuestionCreate XML file with C# Pin
RivasBoy21-Jan-12 7:26
RivasBoy21-Jan-12 7:26 
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:

XML
<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?
AnswerRe: Create XML file with C# Pin
Eddy Vluggen21-Jan-12 11:24
professionalEddy Vluggen21-Jan-12 11:24 
AnswerRe: Create XML file with C# Pin
Nathan Stiles23-Jan-12 10:48
Nathan Stiles23-Jan-12 10:48 
Question.NET Framework 4.0 and 2.0 Pin
MAW3020-Jan-12 11:23
MAW3020-Jan-12 11:23 
AnswerRe: .NET Framework 4.0 and 2.0 Pin
Richard Andrew x6420-Jan-12 11:54
professionalRichard Andrew x6420-Jan-12 11:54 
AnswerRe: .NET Framework 4.0 and 2.0 Pin
jschell20-Jan-12 12:42
jschell20-Jan-12 12:42 
AnswerRe: .NET Framework 4.0 and 2.0 Pin
Shameel20-Jan-12 18:57
professionalShameel20-Jan-12 18:57 
AnswerRe: .NET Framework 4.0 and 2.0 Pin
PIEBALDconsult21-Jan-12 3:12
mvePIEBALDconsult21-Jan-12 3:12 
QuestionSize Image in PictureBox Pin
Steve Harp20-Jan-12 9:40
Steve Harp20-Jan-12 9:40 
AnswerRe: Size Image in PictureBox Pin
Dave Kreskowiak20-Jan-12 10:29
mveDave Kreskowiak20-Jan-12 10:29 
AnswerRe: Size Image in PictureBox Pin
Richard MacCutchan20-Jan-12 22:06
mveRichard MacCutchan20-Jan-12 22:06 
AnswerRe: Size Image in PictureBox Pin
Luc Pattyn20-Jan-12 22:41
sitebuilderLuc Pattyn20-Jan-12 22:41 
GeneralRe: Size Image in PictureBox Pin
Richard MacCutchan20-Jan-12 23:04
mveRichard MacCutchan20-Jan-12 23:04 
GeneralRe: Size Image in PictureBox Pin
Steve Harp23-Jan-12 5:33
Steve Harp23-Jan-12 5:33 
GeneralRe: Size Image in PictureBox Pin
Richard MacCutchan23-Jan-12 6:35
mveRichard MacCutchan23-Jan-12 6:35 
AnswerRe: Size Image in PictureBox Pin
Luc Pattyn23-Jan-12 16:07
sitebuilderLuc Pattyn23-Jan-12 16:07 
GeneralRe: Size Image in PictureBox Pin
Richard MacCutchan23-Jan-12 23:07
mveRichard MacCutchan23-Jan-12 23:07 
QuestionDataBinding Pin
MWRivera20-Jan-12 9:37
MWRivera20-Jan-12 9:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.