Just create a class Player with properties Number and Name, create a List of Players, populate it and then serialize it into XML and that's it...
Juan M. Oviedo> Date: Sat, 20 Dec 2008 03:46:52 -0800> Subject: [DotNetDevelopment] Re: Create XML in C#> From: [email protected]> To: [email protected]> > > Puhleeeez !! Just because you like to write horrible code doesn't mean> you should recommend it to others !!> > On Dec 20, 12:50 pm, "ARUN KUMAR" <[email protected]> wrote:> > Create string for start tag and close tag then create array of string for> > storing content> >> > Eg> >> > Stag="<player>";> >> > Ctag="</player>";> >> > String[] names={"Pete"," Marcus Giles"};// fetch from data base then assign> > to it> >> > Using loop assingn into one string of array finaly> >> > System.IO.File.WriteAllLines ("My.xml", ContArr);> >> > 2008/12/19 Stout <[email protected]>> >> >> >> >> >> >> >> > > How could I create this XML file in C#?> >> > > <players>> > > -> > > <player>> > > <number>4</number>> > > <name>Pete Orr</name>> > > </player>> > > -> > > <player>> > > <number>22</number>> > > <name>Marcus Giles</name>> > > </player>> > > -> > > <player>> > > <number>10</number>> > > <name>Chipper Jones</name>> > > </player>> > > -> > > <player>> > > <number>25</number>> > > <name>Andruw Jones</name>> > > </player>> > > -> > > <player>> > > <number>7</number>> > > <name>Jeff Francoeur</name>> > > </player>> > > -> > > <player>> > > <number>18</number>> > > <name>Ryan Langerhaus</name>> > > </player>> > > -> > > <player>> > > <number>19</number>> > > <name>Adam LaRoche</name>> > > </player>> > > </players>> >> > > Thanks.> >> > --> > Regards> > *******************> > *C.Arun Kumar *> > *******************- Hide quoted text -> >> > - Show quoted text - _________________________________________________________________ It’s the same Hotmail®. If by “same” you mean up to 70% faster. http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad1_122008
