Category: LINQ
-
LINQ to Object Part #2: Filtering and Sorting
Objective In this article, I am going to show, how we could achieve filtering and sorting in LINQ to object I have created two classes for my explanation purpose. Student class is having details of students and Hostel class is having details of hostel. Both classes are having a properties HostelNumber common. I will be…
-
LINQ to Object Part #1: Projection
Objective In this article, I am going to show, how we could achieve projection in LINQ to object. I will explain different types of projection and how to achieve them over a collection using LINQ. I have created two classes for my explanation purpose. Student class is having details of students and Hostel class is…
-
LINQ to XML in SILVERLIGHT 3.0
Objective This article will explain how to use LINQ to XML to read data from a XML file and bind that to SILVERLIGHT 3.0 Data Grid. XML file will be read in a WCF service and WCF service will return a List to be bind in a Grid. Step 1 Create a SILVERLIGHT application. Select…
-
LINQ to XML Part # 5: Catching Parsing Exceptions
Objective This is a very high level article which will explain; how to handle exception in parsing XML using LINQ to XML. Problem Let us say, we are parsing a below string using XElement.Parse String strParse = “<Address><Name>Dhananjay Kumar </Name> “; This string is not valid formed. But XElement.Parse won’t be able to catch the…
-
LINQ to XML Part #4: Different way of Parsing string to create XML tree
Objective In this article, I will show different way of parsing string to create XML tree using LINQ to XML. What is Parsing of XML document? Parsing of XML document means reading XML document, identifies the function of each of the document and then makes this information available in memory for rest of the program.…
-
LINQ to XML Part # 3: Functional Construction of XML Tree
Objective This article will give an explanation on; how to create a XML tree using Functional Construction method of LINQ to XML. What is Functional Construction? Functional Construction is ability to create a XML tree in a single statement. LINQ to XML is being used to create XML tree in a single statement. The features…
-
LINQ to XML Part #2(XElement Class)
Objective In this article, I will give explanation on XElement class. This class is used to construct XML Elements.What is Elements in XML? XML Element is fundamental XML constructs. An Element has a name and optional attributes. An XML Elements can have nested Elements called Nodes also. XElement class XElement Class is defined as below…
-
LINQ to XML Part #1(XAttribute Class)
Objective In this article, I will give explanation on XAttribute class. This class is used to construct Attributes in XML Elements. What is Attribute in XML? XML Attribute is a Name/Value pair associated with XML elements. XAttribute class represents XML Attributes. XAttribute class XAttribute Class is defined as below in namespace System.Xml.Linq. And it inherits…
-
Creating XML Tree from Scratch through LINQ
Objective: This article is going to explain, How to create XML Tree using LINQ? This will be explaining Functional Construction way of creating XML tree. There are three samples given in this article. One for basic XML tree construction, one to construct from array of objects and last to construct XML tree from content of…