-
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!
-
-
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
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|