C# & XML should take the blue pill ;-)
-
Hi! My real name is Antoine Dubuc, and I'm screwed! :omg: I have an xml document with his sidekick schema, and they're both doing fine. There's this textbox that would like to be filled with data from our trusty XML file. So being ignominously screwed in attempting to muster some sense from F1 ( who writes this anyway!???) I am here to ask you some advice. How can I open my xml file, search it to find the right element, say 'First Name', and have it displayed inside the textbox? I know, you are probably thinking ... :laugh: ... I'm a beginner in XML, hence this qustion from which I'd be grateful to receive some specific code example ;) :) Thank you! Antoine Orchus Technologies Coding is a family business
-
Hi! My real name is Antoine Dubuc, and I'm screwed! :omg: I have an xml document with his sidekick schema, and they're both doing fine. There's this textbox that would like to be filled with data from our trusty XML file. So being ignominously screwed in attempting to muster some sense from F1 ( who writes this anyway!???) I am here to ask you some advice. How can I open my xml file, search it to find the right element, say 'First Name', and have it displayed inside the textbox? I know, you are probably thinking ... :laugh: ... I'm a beginner in XML, hence this qustion from which I'd be grateful to receive some specific code example ;) :) Thank you! Antoine Orchus Technologies Coding is a family business
Use the .NET Xml* classes to load the XML file, then you can search through the resultant XML tree to find the right element, then (I assume you're doing this within the Page_Load event of an ASP.NET page) set the text of the appropriate text input element in your ASP.NET page by setting the TextBox.Text property as the value of the element in the XML tree. cheers, Chris Maunder
-
Use the .NET Xml* classes to load the XML file, then you can search through the resultant XML tree to find the right element, then (I assume you're doing this within the Page_Load event of an ASP.NET page) set the text of the appropriate text input element in your ASP.NET page by setting the TextBox.Text property as the value of the element in the XML tree. cheers, Chris Maunder
The project for this is a Windows Form project. What classes ?! I mean, I'm a beginner, I tried XmlDataDocument and I load the xml file into it. Ok. Now, what do I use to search the right node and output the element to the textbox? :) Thank you :) Antoine Coding is a family business
-
The project for this is a Windows Form project. What classes ?! I mean, I'm a beginner, I tried XmlDataDocument and I load the xml file into it. Ok. Now, what do I use to search the right node and output the element to the textbox? :) Thank you :) Antoine Coding is a family business
Hi, The following code loads the text in the tag "/root/firstname" of the file "c:\xmlfile.xml" into a textbox named "FirstNametextbox".
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
xmlDoc.Load(@"c:\xmlfile.xml");
XmlNode node = xmlDoc.SelectSingleNode(@"/root/firstname");
FirstNametextbox.Text=node.InnerText;HTH, J Dunlap
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi -
Hi! My real name is Antoine Dubuc, and I'm screwed! :omg: I have an xml document with his sidekick schema, and they're both doing fine. There's this textbox that would like to be filled with data from our trusty XML file. So being ignominously screwed in attempting to muster some sense from F1 ( who writes this anyway!???) I am here to ask you some advice. How can I open my xml file, search it to find the right element, say 'First Name', and have it displayed inside the textbox? I know, you are probably thinking ... :laugh: ... I'm a beginner in XML, hence this qustion from which I'd be grateful to receive some specific code example ;) :) Thank you! Antoine Orchus Technologies Coding is a family business
Try this: http://www.codeproject.com/csharp/app\_config.asp ===================== http://wasp.elcat.kg
-
Hi, The following code loads the text in the tag "/root/firstname" of the file "c:\xmlfile.xml" into a textbox named "FirstNametextbox".
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
xmlDoc.Load(@"c:\xmlfile.xml");
XmlNode node = xmlDoc.SelectSingleNode(@"/root/firstname");
FirstNametextbox.Text=node.InnerText;HTH, J Dunlap
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma GandhiThank you very much! :) Antoine Coding is a family business
-
Hi! My real name is Antoine Dubuc, and I'm screwed! :omg: I have an xml document with his sidekick schema, and they're both doing fine. There's this textbox that would like to be filled with data from our trusty XML file. So being ignominously screwed in attempting to muster some sense from F1 ( who writes this anyway!???) I am here to ask you some advice. How can I open my xml file, search it to find the right element, say 'First Name', and have it displayed inside the textbox? I know, you are probably thinking ... :laugh: ... I'm a beginner in XML, hence this qustion from which I'd be grateful to receive some specific code example ;) :) Thank you! Antoine Orchus Technologies Coding is a family business