-
How to select an Element of an xml file in Asp.net
Hi guys
I need to assign elements in an xml file to a variable .
I am not familiar with xml .
If any body could provide me with some code I will appreciate it.
Here is my code .
@@@@@@@@@@@@@@@@@@@
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load("myxmlfile.xml");
@firstname = xmldoc.SelectElement("firstname");
@lastname = xmldoc.SelectElement("lastname");
@@@@@@@@@@@@@@@@@@@@
I know my code is wrong, If any body suggest the write code??
This project is developed in ASP.net using C#.
Thanks In advance.
-
What does the XML file look like?
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
-
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
XML file look like
<Controls>
<AdFeatImage1>
<FeaturePageId>1</FeaturePageId>
<FeatureTypeId>1</FeatureTypeId>
<LogThis>True</LogThis>
<IP>'127.0.0.1'</IP>
<BannerDomain>0</BannerDomain>
</AdFeatImage1>
<AdFeatImage2>
<FeaturePageId>1</FeaturePageId>
<FeatureTypeId>124</FeatureTypeId>
<LogThis>True</LogThis>
<IP>'127.0.0.1'</IP>
<BannerDomain>0</BannerDomain>
</AdFeatImage2>
<AdFeatImage3>
<FeaturePageId>1</FeaturePageId>
<FeatureTypeId>123</FeatureTypeId>
<LogThis>True</LogThis>
<IP>'127.0.0.1'</IP>
<BannerDomain>0</BannerDomain>
</AdFeatImage3>
</Controls>
-
I don't see 'firstname' or 'lastname' elements in that file. Which elements do you want to extract?
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Similar Threads
-
By Hallo2oo5 in forum XML
Replies: 1
Last Post: 04-24-2007, 08:33 AM
-
Replies: 1
Last Post: 07-18-2002, 05:46 PM
-
By ASPSmith Training in forum dotnet.announcements
Replies: 0
Last Post: 06-18-2002, 03:39 AM
-
By Tim Frost in forum xml.announcements
Replies: 0
Last Post: 04-02-2001, 10:53 AM
-
By Nirit Touboul in forum Database
Replies: 7
Last Post: 02-25-2001, 11:34 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks