Click here to Skip to main content
15,892,059 members
Home / Discussions / C#
   

C#

 
AnswerRe: .net application without frame Pin
Samer Aburabie24-Aug-08 8:32
Samer Aburabie24-Aug-08 8:32 
AnswerRe: .net application without frame Pin
Pete O'Hanlon24-Aug-08 10:27
mvePete O'Hanlon24-Aug-08 10:27 
Questionon minimize go to takbar near clock Pin
help as an alias23-Aug-08 10:41
help as an alias23-Aug-08 10:41 
AnswerRe: on minimize go to takbar near clock Pin
zafersavas23-Aug-08 11:06
zafersavas23-Aug-08 11:06 
AnswerRe: on minimize go to takbar near clock Pin
Nirandas23-Aug-08 18:10
Nirandas23-Aug-08 18:10 
AnswerRe: on minimize go to takbar near clock Pin
Hamid_RT23-Aug-08 18:31
Hamid_RT23-Aug-08 18:31 
GeneralRe: on minimize go to takbar near clock Pin
Paul Conrad23-Aug-08 19:24
professionalPaul Conrad23-Aug-08 19:24 
QuestionXML - access "next child".. how? Pin
Joplinazz23-Aug-08 7:52
Joplinazz23-Aug-08 7:52 
Hello,
I'm working on a little app which retrieves info from an XML-file
and shows the info to the user in a listbox.
Here's my XML-file:

<?xml version="1.0"?>
<Orders>
  <Order OrderID="001">
    <Job>VHS till DVD</Job>
    <Price>800</Price>
    <Status>Ej betalt</Status>
    <Name>Erik Stendal</Name>
    <PersonalNum>881107-0252</PersonalNum>
    <Address>Gutegatan 122B</Address>
    <ZipCity>566453 Göteborg</ZipCity>
    <Phone>0708888988</Phone>
    <Email>erik@hotmail.com</Email>
  </Order>
</Orders>


And here's my C# code:
private void Form1_Load(object sender, EventArgs e)
        {
            //Open a FileStream on the Xml file
            FileStream docIn =
            new FileStream(docPath, FileMode.Open, FileAccess.Read,     FileShare.ReadWrite);
            ordersDoc = new XmlDocument();
            //Load the Xml Document
            ordersDoc.Load(docIn);
            //Display the contacts
            DisplayContacts();
        }

        private void DisplayContacts()
        {
            XmlNodeList ordersList =        ordersDoc.GetElementsByTagName("Order");

            for (int i = 0; i < ordersList.Count; i++)
            {
                XmlAttributeCollection attrColl = ordersList[i].Attributes;
                listBox1.Items.Add(attrColl[0].Value + "\t" +
                    ordersList[i].FirstChild.InnerText + "\t");
            }


        }


Now, if you look at my XML-file I also want to access the rest
of the info.. Like the price and the status. All I can find is
"lastchild.innertext", but obviously that's not what I need. So, what can
I do to accomplish my goal?

/Joplinazz
AnswerRe: XML - access "next child".. how? Pin
Mbah Dhaim23-Aug-08 8:53
Mbah Dhaim23-Aug-08 8:53 
GeneralRe: XML - access "next child".. how? Pin
Joplinazz23-Aug-08 9:27
Joplinazz23-Aug-08 9:27 
AnswerRe: XML - access "next child".. how? Pin
dybs23-Aug-08 10:24
dybs23-Aug-08 10:24 
GeneralRe: XML - access "next child".. how? Pin
Joplinazz24-Aug-08 2:31
Joplinazz24-Aug-08 2:31 
GeneralRe: XML - access "next child".. how? Pin
dybs24-Aug-08 5:37
dybs24-Aug-08 5:37 
AnswerRe: XML - access "next child".. how? Pin
Samer Aburabie24-Aug-08 8:37
Samer Aburabie24-Aug-08 8:37 
QuestionEmail Sender not sending to gmail,hotmail etc but will send to the domain from it is sent addresses Pin
new2pgrmg23-Aug-08 5:59
new2pgrmg23-Aug-08 5:59 
AnswerRe: Email Sender not sending to gmail,hotmail etc but will send to the domain from it is sent addresses Pin
Mbah Dhaim24-Aug-08 10:42
Mbah Dhaim24-Aug-08 10:42 
AnswerRe: Email Sender not sending to gmail,hotmail etc but will send to the domain from it is sent addresses Pin
#realJSOP25-Aug-08 2:58
mve#realJSOP25-Aug-08 2:58 
QuestionPrinting a Certificate Form Pin
Ian Uy23-Aug-08 4:13
Ian Uy23-Aug-08 4:13 
AnswerRe: Printing a Certificate Form Pin
Abhijit Jana23-Aug-08 4:25
professionalAbhijit Jana23-Aug-08 4:25 
GeneralRe: Printing a Certificate Form Pin
Paul Conrad23-Aug-08 6:07
professionalPaul Conrad23-Aug-08 6:07 
AnswerRe: Printing a Certificate Form Pin
Paul Conrad23-Aug-08 6:10
professionalPaul Conrad23-Aug-08 6:10 
Question"Save As" Dailog box problem Pin
Saum_Vora23-Aug-08 1:19
Saum_Vora23-Aug-08 1:19 
QuestionFunction to insert an integer into a sorted array of integers Pin
Samiullah22-Aug-08 21:06
Samiullah22-Aug-08 21:06 
AnswerRe: Function to insert an integer into a sorted array of integers Pin
zafersavas22-Aug-08 22:55
zafersavas22-Aug-08 22:55 
GeneralRe: Function to insert an integer into a sorted array of integers Pin
Samiullah23-Aug-08 0:43
Samiullah23-Aug-08 0:43 

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.