Click here to Skip to main content
15,924,367 members
Home / Discussions / C#
   

C#

 
AnswerRe: .net 2.0 generic type collection - loop Pin
User 66587-Mar-07 3:02
User 66587-Mar-07 3:02 
GeneralRe: .net 2.0 generic type collection - loop Pin
Dario Solera7-Mar-07 5:03
Dario Solera7-Mar-07 5:03 
GeneralRe: .net 2.0 generic type collection - loop Pin
User 66587-Mar-07 5:27
User 66587-Mar-07 5:27 
GeneralWith .Net 2.0 not so much Pin
Ennis Ray Lynch, Jr.7-Mar-07 6:01
Ennis Ray Lynch, Jr.7-Mar-07 6:01 
Questionwhat is this error about? Pin
pashitech7-Mar-07 2:31
pashitech7-Mar-07 2:31 
AnswerRe: what is this error about? Pin
Pete O'Hanlon7-Mar-07 2:48
mvePete O'Hanlon7-Mar-07 2:48 
GeneralRe: what is this error about? Pin
pashitech7-Mar-07 2:53
pashitech7-Mar-07 2:53 
GeneralRe: what is this error about? Pin
Colin Angus Mackay7-Mar-07 3:17
Colin Angus Mackay7-Mar-07 3:17 
Gosh! That code is very difficult to read because of all the commented out lines. This can be quite confusing.

Here is a cleaner version of the code you've supplied:
public string[] GetLaserProp(string laserid, string parentnode1, string childnode1)
{
    XmlDocument xmldoc = new XmlDocument();
    xmldoc.Load(@"E:\Dropdown_XML\laserProp.xml");
    string[] str = new string[5];

    XmlNodeList xmlnodelst = xmldoc.GetElementsByTagName(parentnode1);
    foreach (XmlNode parentnode in xmlnodelst)
    {
        if (parentnode.Attributes.Item(0).Value == laserid)
        {
            xmldoc.LoadXml(parentnode.InnerXml);
            XmlNodeList xmlchildnodelst = xmldoc.GetElementsByTagName(childnode1);
            foreach (XmlNode childnode in xmlchildnodelst)
            {
                for (int i = 0; i < childnode.ChildNodes.Count; i++)
                {

                    for (int j = 0; j < childnode.ChildNodes.Item(i).Attributes.Count; j++)
                    {
                        str[j]= childnode.ChildNodes.Item(i).Attributes.Item(j).Value;
                        return str; 
                    }
                }
            }
        }
    }
    return str;
}


Which line contained the error, because I cannot see anything here that would cause the error. Perhaps, as Pete suggested, the error is in the caller.


Upcoming events:
* Edinburgh: Web Security Conference Day for Windows Developers (12th April)
* Glasgow: AJAX, SQL Server, Mock Objects


My: Website | Blog | Photos

GeneralRe: what is this error about? Pin
User 66587-Mar-07 3:27
User 66587-Mar-07 3:27 
GeneralRe: what is this error about? [modified] Pin
Pete O'Hanlon7-Mar-07 3:29
mvePete O'Hanlon7-Mar-07 3:29 
GeneralRe: what is this error about? Pin
Guffa7-Mar-07 3:58
Guffa7-Mar-07 3:58 
GeneralRe: what is this error about? Pin
Pete O'Hanlon7-Mar-07 4:05
mvePete O'Hanlon7-Mar-07 4:05 
QuestionMultiple opennings of same form at a time. Pin
Janu_M7-Mar-07 2:20
Janu_M7-Mar-07 2:20 
AnswerRe: Multiple opennings of same form at a time. Pin
Victor Boba7-Mar-07 3:02
Victor Boba7-Mar-07 3:02 
AnswerRe: Multiple opennings of same form at a time. Pin
RedRummy7-Mar-07 3:03
RedRummy7-Mar-07 3:03 
AnswerRe: Multiple opennings of same form at a time. [modified] Pin
Russell Jones7-Mar-07 5:48
Russell Jones7-Mar-07 5:48 
GeneralRe: Multiple opennings of same form at a time. Pin
Janu_M7-Mar-07 17:44
Janu_M7-Mar-07 17:44 
QuestionIs that possible to check ports are scanned Pin
F.E.L.I.X.7-Mar-07 2:10
F.E.L.I.X.7-Mar-07 2:10 
AnswerRe: Is that possible to check ports are scanned Pin
Ennis Ray Lynch, Jr.7-Mar-07 6:06
Ennis Ray Lynch, Jr.7-Mar-07 6:06 
QuestionDateTimePicker Pin
hadad7-Mar-07 1:53
hadad7-Mar-07 1:53 
AnswerRe: DateTimePicker Pin
PIEBALDconsult7-Mar-07 4:48
mvePIEBALDconsult7-Mar-07 4:48 
AnswerRe: DateTimePicker Pin
V.7-Mar-07 4:50
professionalV.7-Mar-07 4:50 
Questionhow to use multiple description coding in c# Pin
Member 38122567-Mar-07 1:09
Member 38122567-Mar-07 1:09 
AnswerRe: how to use multiple description coding in c# Pin
Colin Angus Mackay7-Mar-07 2:16
Colin Angus Mackay7-Mar-07 2:16 
QuestionWriting clientside applications in c# Pin
Mr Withers7-Mar-07 0:36
Mr Withers7-Mar-07 0:36 

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.