TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Daniel Golan
NA
45
47.6k
Reading node by name
Jan 8 2011 2:58 AM
Hello =)
if (lab_url.Text == "")
{
lab_url.Text = "C:/Users/Daxal/documents/visual studio 2010/Projects/Yr/Yr/XML/fjellstrand.xml";
}
//open xml
XDocument xmlDoc = XDocument.Load("C:/Users/Daxal/Dropbox/C#/Yr/Yr/XML/url.xml");
//read xml
var xmlAtt = from att in xmlDoc.Elements("yrurl").Elements("Name").Attributes("Url")
select att;
foreach (var loc in xmlAtt)
{
lab_url.Text = loc.Value;
}
which is reading the xml :
<?xml version="1.0"?>
<yrurl>
<Name Url ="http://www.yr.no/sted/Norge/Oslo/Oslo/Oslo/varsel.xml">Oslo</Name>
<Name Url ="http://www.yr.no/sted/Norge/Akershus/Ski/Ski/varsel.xml">Ski</Name>
</yrurl>
How can i use the c# code to only read the url from oslo (in the xml) ?
Any hints or tips are greatly appriciated ! :)
Reply
Answers (
2
)
update database via linq by iterating formcontrols ?
Stored Procedure successfull execution using LINQ