Can you please explain how to use Linq?
XML:
<books>
<book>
<Author>AuthorT xt</Author>
<Title>TitleTxt </Title>
</book>
</books>
When I try using your LINQ to look for book it works but when I try to look for Author it crashes.
User Profile
Collapse
-
I guess you're right.
I wanted to find a build-in method and avoid loading it to memory but DataSet is not that bad.
Thanks
ex: xmlFile "XMLFile1.x ml"
xmlPath "/books/book/Author"
XML:
<?xml version="1.0" encoding="utf-8" ?>
<books>
<book>
<Author>AuthorT xt</Author>
</book>
</books>...Leave a comment:
-
I want to avoid using collections. All I want to do is to pull a simple value out from the xml.
ThanksLeave a comment:
-
if you want something Enumerable, you got to create a class that implements IEnumerable. Take a look at this example.
http://www.codeproject.com/KB/cs/csenumerators.aspx
If you're totally new to C#, I would suggest learning implementing IComparable first. IComparable allows you to compare object using '<', '>', '='.
ex: object1 > object2...Leave a comment:
-
Reading XML in 1 line.
The XML I have is same as web.config where data do not repeat. I want a very handy method to pull data out of the xml.
What I want is ex:
1. Response.Write( Xml("\\Roots\No de\Element"))
2. <% Xml("\\Roots\No de\Element") %>
I've gone through many example with XMLReader, Xnode, etc.. but they all involve looping over the xml which I don't want. I want to point it...
No activity results to display
Show More
Leave a comment: