Click here to Skip to main content
15,913,055 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Connection to Northwind via SQL - HELP Pin
Jethro6313-Apr-05 15:22
Jethro6313-Apr-05 15:22 
GeneralRe: C# Connection to Northwind via SQL - HELP Pin
Mushtaque Nizamani25-Oct-07 4:41
Mushtaque Nizamani25-Oct-07 4:41 
GeneralPainting Issue Pin
Mark_Harrison12-Apr-05 2:05
Mark_Harrison12-Apr-05 2:05 
GeneralRe: Painting Issue Pin
S. Senthil Kumar12-Apr-05 3:26
S. Senthil Kumar12-Apr-05 3:26 
Generalcreating code demo Pin
rmedo12-Apr-05 1:56
rmedo12-Apr-05 1:56 
GeneralRe: creating code demo Pin
eggie512-Apr-05 13:58
eggie512-Apr-05 13:58 
GeneralRe: creating code demo Pin
rmedo13-Apr-05 4:34
rmedo13-Apr-05 4:34 
GeneralC# & XML & nested loops problem (try 2) Pin
Anonymous12-Apr-05 1:47
Anonymous12-Apr-05 1:47 
(Previous can be deleted, my XML wasn't shown properly)

Hello,

I'm working on a C# console program.
Now I've encountered the following problem:

I read data from a MS-SQL database and create Article objects with this data (own class).
An Article object exists out of the following members: custIDa, custIDb, docID, accountNr,

tCode, tTarif, VAT.

A customer can have multiple articles (so when custIDa is for example 1 it can have docID =

1 and docID = 2 (so 2 articles)).

I add every Article object to an ArrayList (and maybe I'll sort it).

What I want to accomplish is the following:

I want to run through the ArrayList and write the Article-data to XML like this:

<RootNode>
<Customer IDa="1" IDb="UX200">
<Article docID="invoice001">
<AccountNr value="453-2513-564" />
<Code value="Foreign" />
<Tarif value="5" />
<VAT value="250" />
</Article>
</Customer>
<Customer IDa="2" IDb="BF500">
<Article docID="invoice007">
<AccountNr value="456-5465-546" />
<Code value="Domestic" />
<Tarif value="2" />
<VAT value="120" />
</Article>
<Article docID="invoice008">
<AccountNr value="456-5465-546" />
<Code value="Domestic" />
<Tarif value="2" />
<VAT value="568" />
</Article>
</Customer>
</RootNode>

I think I'll have to do this with a nested loop, 1 to check if custIDa is the same or has

changed and one for the docID's.

So custIDa can occur multiple times with everytime a changed docID (you could state that

it's a combined primary key as in SQL).

Anyone can help me out with this or has any ideas to help me out 'cause I'm really stuck

here Frown | :(

Thanks in advance!

PS: Sorry for my English, I'm from Belgium Wink | ;)
GeneralRe: C# &amp; XML &amp; nested loops problem (try 2) Pin
hooray12-Apr-05 2:11
hooray12-Apr-05 2:11 
GeneralRe: C# &amp; XML &amp; nested loops problem (try 2) Pin
Anonymous12-Apr-05 2:38
Anonymous12-Apr-05 2:38 
GeneralC# &amp; XML &amp; nested loops problem Pin
Anonymous12-Apr-05 1:45
Anonymous12-Apr-05 1:45 
GeneralRe: C# &amp; XML &amp; nested loops problem Pin
Ian Bowler12-Apr-05 7:45
Ian Bowler12-Apr-05 7:45 
GeneralRe: C# &amp; XML &amp; nested loops problem Pin
Anonymous12-Apr-05 23:31
Anonymous12-Apr-05 23:31 
GeneralProb with creating user control Pin
Anonymous12-Apr-05 1:03
Anonymous12-Apr-05 1:03 
GeneralRe: Prob with creating user control Pin
Judah Gabriel Himango12-Apr-05 4:38
sponsorJudah Gabriel Himango12-Apr-05 4:38 
Generalon Signed Assemblies in .Net Pin
ppp00112-Apr-05 0:29
ppp00112-Apr-05 0:29 
GeneralThreading.Timer callback called multiple times Pin
sjhart12-Apr-05 0:23
sjhart12-Apr-05 0:23 
GeneralRe: Threading.Timer callback called multiple times Pin
Mike Dimmick12-Apr-05 2:43
Mike Dimmick12-Apr-05 2:43 
GeneralRe: Threading.Timer callback called multiple times Pin
sjhart12-Apr-05 3:05
sjhart12-Apr-05 3:05 
GeneralC#, COM &amp; Type Libraries Pin
MrEyes12-Apr-05 0:13
MrEyes12-Apr-05 0:13 
Questionhow to send http streams in c# Pin
arusmemon11-Apr-05 23:53
arusmemon11-Apr-05 23:53 
AnswerRe: how to send http streams in c# Pin
Claudio Grazioli12-Apr-05 3:05
Claudio Grazioli12-Apr-05 3:05 
GeneralRe: Setting file attributes Pin
hooray12-Apr-05 1:10
hooray12-Apr-05 1:10 
GeneralUnsafe code on a webserver - 2bpp images Pin
Mark Otway11-Apr-05 23:39
Mark Otway11-Apr-05 23:39 
GeneralRe: Unsafe code on a webserver - 2bpp images Pin
Mark Otway12-Apr-05 20:38
Mark Otway12-Apr-05 20:38 

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.