Click here to Skip to main content
15,893,790 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to resolve class type using enum Pin
jschell25-Jan-12 14:50
jschell25-Jan-12 14:50 
GeneralRe: How to resolve class type using enum Pin
Dean Oliver23-Jan-12 18:20
Dean Oliver23-Jan-12 18:20 
GeneralRe: How to resolve class type using enum Pin
BobJanova24-Jan-12 10:32
BobJanova24-Jan-12 10:32 
QuestionTask cancellation Pin
michaelgr122-Jan-12 3:59
michaelgr122-Jan-12 3:59 
AnswerRe: Task cancellation Pin
Dave Kreskowiak22-Jan-12 8:15
mveDave Kreskowiak22-Jan-12 8:15 
Questionhow to retrieve a single value from datatable Pin
mschotamaster21-Jan-12 22:01
mschotamaster21-Jan-12 22:01 
AnswerRe: how to retrieve a single value from datatable Pin
Richard MacCutchan21-Jan-12 23:01
mveRichard MacCutchan21-Jan-12 23:01 
GeneralRe: how to retrieve a single value from datatable Pin
mschotamaster22-Jan-12 3:12
mschotamaster22-Jan-12 3:12 
GeneralRe: how to retrieve a single value from datatable Pin
Richard MacCutchan22-Jan-12 3:15
mveRichard MacCutchan22-Jan-12 3:15 
GeneralRe: how to retrieve a single value from datatable Pin
mschotamaster22-Jan-12 3:17
mschotamaster22-Jan-12 3:17 
GeneralRe: how to retrieve a single value from datatable Pin
Richard MacCutchan22-Jan-12 3:23
mveRichard MacCutchan22-Jan-12 3:23 
GeneralRe: how to retrieve a single value from datatable Pin
mschotamaster22-Jan-12 3:38
mschotamaster22-Jan-12 3:38 
GeneralRe: how to retrieve a single value from datatable Pin
Nathan Stiles23-Jan-12 10:45
Nathan Stiles23-Jan-12 10:45 
AnswerRe: how to retrieve a single value from datatable Pin
Eddy Vluggen22-Jan-12 3:41
professionalEddy Vluggen22-Jan-12 3:41 
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 

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.