Click here to Skip to main content
15,897,187 members
Home / Discussions / C#
   

C#

 
GeneralRe: Assigning Variables in C# for ORACLE Pin
KingJames065-Nov-12 22:13
KingJames065-Nov-12 22:13 
GeneralRe: Assigning Variables in C# for ORACLE Pin
Eddy Vluggen5-Nov-12 23:45
professionalEddy Vluggen5-Nov-12 23:45 
GeneralRe: Assigning Variables in C# for ORACLE Pin
KingJames066-Nov-12 14:38
KingJames066-Nov-12 14:38 
GeneralRe: Assigning Variables in C# for ORACLE Pin
Eddy Vluggen6-Nov-12 22:45
professionalEddy Vluggen6-Nov-12 22:45 
QuestionC#, Win'7, Port Mystery Pin
C-P-User-35-Nov-12 12:49
C-P-User-35-Nov-12 12:49 
AnswerRe: C#, Win'7, Port Mystery Pin
Pete O'Hanlon5-Nov-12 22:18
mvePete O'Hanlon5-Nov-12 22:18 
GeneralRe: C#, Win'7, Port Mystery Pin
C-P-User-36-Nov-12 6:03
C-P-User-36-Nov-12 6:03 
QuestionReading XML Pin
Kevin Marois5-Nov-12 7:34
professionalKevin Marois5-Nov-12 7:34 
I must be slipping. This used to work...

The XML file:
<?xml version="1.0" encoding="utf-8"?>
<Properties>
  <PropertyEditor>
    <Property ViewName = "Characteristics" PropertyName = "ValueLand" DisplayName = "Land Value" DataType = "numeric"/>
    <Property ViewName = "Characteristics" PropertyName = "ValueStructure" DisplayName = "Structure Value" DataType = "numeric"/>
    <Property ViewName = "Characteristics" PropertyName = "ValuePersonal" DisplayName = "Personal Value" DataType = "numeric"/>
  </PropertyEditor>
</Properties>


and the code to read it

private void GetPropertyData()
{
    propertyDatas = new List<PropertyData>();

    string path = Path.GetDirectoryName(Application.ExecutablePath) + @"\EditorProperties.xml";

    XmlTextReader reader = new XmlTextReader(path);

    XmlDocument doc = new XmlDocument();
    XmlNode node = doc.ReadNode(reader);

    foreach (XmlNode childNode in node.ChildNodes)
    {
        foreach (XmlAttribute att in childNode.Attributes)
        {
            PropertyData propertyData = new PropertyData
            {
                ViewName = att.Attributes["Characteristics"].Value,
                PropertyName = att.Attributes["PropertyName"].Value,
                DisplayName = att.Attributes["DisplayName"].Value,
                DataType = att.Attributes["numeric"].Value
            };

            propertyDatas.Add(propertyData);
        }
    }
}


Now, for some reason, it reads the 'XML' line, then the code skips out on the first foreach.

What's wrong here?

Thanks
If it's not broken, fix it until it is

AnswerRe: Reading XML Pin
Eddy Vluggen5-Nov-12 8:25
professionalEddy Vluggen5-Nov-12 8:25 
GeneralRe: Reading XML Pin
Kevin Marois5-Nov-12 10:09
professionalKevin Marois5-Nov-12 10:09 
GeneralRe: Reading XML Pin
Eddy Vluggen5-Nov-12 10:20
professionalEddy Vluggen5-Nov-12 10:20 
AnswerRe: Reading XML Pin
Clifford Nelson5-Nov-12 12:23
Clifford Nelson5-Nov-12 12:23 
QuestionGenerics? Pin
David Knechtges5-Nov-12 5:50
David Knechtges5-Nov-12 5:50 
AnswerRe: Generics? Pin
Alan Balkany5-Nov-12 5:53
Alan Balkany5-Nov-12 5:53 
AnswerRe: Generics? Pin
harold aptroot5-Nov-12 5:59
harold aptroot5-Nov-12 5:59 
AnswerRe: Generics? Pin
Matt T Heffron5-Nov-12 11:29
professionalMatt T Heffron5-Nov-12 11:29 
QuestionMy DataGridView - FirstDisplayedScrollingRowIndex Pin
Paramu19735-Nov-12 5:06
Paramu19735-Nov-12 5:06 
QuestionGetter Pin
C-P-User-35-Nov-12 2:49
C-P-User-35-Nov-12 2:49 
AnswerRe: Getter Pin
J4amieC5-Nov-12 3:01
J4amieC5-Nov-12 3:01 
GeneralRe: Getter Pin
C-P-User-35-Nov-12 4:30
C-P-User-35-Nov-12 4:30 
GeneralRe: Getter Pin
Dave Kreskowiak5-Nov-12 4:43
mveDave Kreskowiak5-Nov-12 4:43 
GeneralRe: Getter Pin
J4amieC5-Nov-12 4:44
J4amieC5-Nov-12 4:44 
GeneralRe: Getter Pin
Pete O'Hanlon5-Nov-12 4:47
mvePete O'Hanlon5-Nov-12 4:47 
AnswerRe: Getter Pin
Abhinav S5-Nov-12 5:37
Abhinav S5-Nov-12 5:37 
GeneralRe: Getter Pin
C-P-User-35-Nov-12 7:18
C-P-User-35-Nov-12 7:18 

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.