Click here to Skip to main content
15,896,557 members
Home / Discussions / C#
   

C#

 
GeneralRe: Random numbers Pin
Som Shekhar3-Apr-10 1:13
Som Shekhar3-Apr-10 1:13 
GeneralRe: Random numbers Pin
Abhinav S3-Apr-10 1:24
Abhinav S3-Apr-10 1:24 
GeneralRe: Random numbers Pin
harold aptroot3-Apr-10 1:47
harold aptroot3-Apr-10 1:47 
GeneralRe: Random numbers Pin
Abhinav S3-Apr-10 1:52
Abhinav S3-Apr-10 1:52 
GeneralRe: Random numbers Pin
Som Shekhar3-Apr-10 1:58
Som Shekhar3-Apr-10 1:58 
GeneralRe: Random numbers Pin
Abhinav S3-Apr-10 2:01
Abhinav S3-Apr-10 2:01 
QuestionConnexion with my database .sdf with c# smart device project Pin
Tunisien862-Apr-10 23:32
Tunisien862-Apr-10 23:32 
Question(Xml) Reading a Selected Node Attributes [modified] Pin
xEvOx2-Apr-10 22:58
xEvOx2-Apr-10 22:58 
right usually when i read Xml I do it like this :
XmlDocument XmlDoc = new XmloDocument();
XmlDoc.Load("C:\\Example.xml");
XmlNodeList XmlnodeyList = XmlDoc.SelectNodes("Xml/Node");
foreach(XmlNode Nodey in XmlNodeyList)
{
  listView1.Items.Add((string.format("{0}", Nodey.Attributes["ExampleNode"].Value.ToString())));
}


Now that then populates a listview with the nodes in the xml file, I now have been pulling my hair out trying get it to red the second area of the nodes for example in the xml file :
<Node ExampleNode='Meh' SecondNode='Example' />  Sorry CodeProject Wouldent display it properally :)

i want it to read the SecondNode but since i have say 4 of them all diffrent i want it to then read it and make a label have the secondnode text from the listview selected item , Here is the code i wrote for it :
string Name = listView1.SelectedItems[0].ToString();
            XmlDocument XmlDoc = new XmlDocument();
            XmlDoc.Load(XmlPath);
            XmlNode Nodey = XmlDoc.SelectSingleNode(string.Format("Xml/Node/{0}", Name));
            label1.Text = (string.Format("{0}", Nodey.Attributes["SecondNode"].Value.ToString()));

so on click from the listview it gets the second node etc ,
any help wouyld be grand guys !

Jed
modified on Saturday, April 3, 2010 5:11 AM

Questionloged in user Pin
netJP12L2-Apr-10 16:46
netJP12L2-Apr-10 16:46 
AnswerRe: loged in user Pin
Eddy Vluggen3-Apr-10 14:32
professionalEddy Vluggen3-Apr-10 14:32 
QuestionDownload Video from YouTube Pin
harsimranb2-Apr-10 14:32
harsimranb2-Apr-10 14:32 
AnswerRe: Download Video from YouTube Pin
AspDotNetDev2-Apr-10 14:57
protectorAspDotNetDev2-Apr-10 14:57 
GeneralRe: Download Video from YouTube Pin
harsimranb2-Apr-10 15:13
harsimranb2-Apr-10 15:13 
GeneralRe: Captuing JSON Pin
harsimranb2-Apr-10 18:00
harsimranb2-Apr-10 18:00 
Questionsound card Pin
FlavioAR2-Apr-10 12:30
FlavioAR2-Apr-10 12:30 
AnswerRe: sound card Pin
DaveyM693-Apr-10 3:23
professionalDaveyM693-Apr-10 3:23 
QuestionCtrl+Z character in C# Pin
Kujtim Hyseni2-Apr-10 8:43
Kujtim Hyseni2-Apr-10 8:43 
AnswerRe: Ctrl+Z character in C# PinPopular
Ravi Bhavnani2-Apr-10 9:13
professionalRavi Bhavnani2-Apr-10 9:13 
GeneralRe: Ctrl+Z character in C# Pin
PIEBALDconsult2-Apr-10 10:03
mvePIEBALDconsult2-Apr-10 10:03 
GeneralRe: Ctrl+Z character in C# Pin
Ravi Bhavnani2-Apr-10 10:07
professionalRavi Bhavnani2-Apr-10 10:07 
GeneralRe: Ctrl+Z character in C# Pin
The Man from U.N.C.L.E.2-Apr-10 10:47
The Man from U.N.C.L.E.2-Apr-10 10:47 
GeneralRe: Ctrl+Z character in C# Pin
Khaniya2-Apr-10 18:33
professionalKhaniya2-Apr-10 18:33 
GeneralRe: Ctrl+Z character in C# Pin
Rajesh Anuhya2-Apr-10 22:23
professionalRajesh Anuhya2-Apr-10 22:23 
AnswerRe: Ctrl+Z character in C# Pin
Richard MacCutchan2-Apr-10 23:26
mveRichard MacCutchan2-Apr-10 23:26 
QuestionSetting the region of a computer from a C# program... Pin
glauben2-Apr-10 8:37
glauben2-Apr-10 8:37 

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.