Programming techniques and codes for Asp.net , C# Examples , VB.net Examples , MVC Examples , Sql Server , Javascript , .Net Tips , C# Tip , .Net Beginners, Selenium C# WebDriver Tool. This is pure .Net Blog .
You can Get Real World Examples Over Here.
Before .Net 4.0 we are using System.Web.Caching.Cache object. Now in .Net 4.0 introduce same system.web.caching functionality in System.Runtime.Caching.dll everything was rebuilt into the new namespace of System.Runtime.Caching. Here is Example for this. Read More...
This is a situations where you have an string array which contains some string element or values and some integer values and we want to parse that integer values from that List or array and retrieve only integer values. We can do with the help of LINQ. We can create an extension method of linq and achieve this. This LINQ extension method is very useful. Read More...
You can create your own custom LINQ extension method in .Net Application. These extension methods are very handy in software development. Creating a LINQ extension method in VB.Net has Different approach than C#.Net . For that we need to create "Module" and in this Module we create a methods and add this "" attribute to this methods. Read More...
There is a need to create a custom LINQ extension method in .Net Application. This is a very good .Net Framework feature. These extension methods are very handy in software development. For that we need to create Static Class and Static Methods. Here is example for this. Read More...
There is a situations where you want to Concatenate Or Combine one or more data sources using LINQ. With the help of the Concat<> extension method to concatenate or combine multiple sources into a single data source. Here is example of this. Read More...
There is a situations where you need to convert LINQ result or IEnumerable<> object into Dictionary object. This is possible with the help of the LINQ Extension methods. Here is example for this. In this example we convert One LINQ's IEnumerable<> result in to Dictionary object. Read More...
You can union of two LINQ query or Results. You can also say combine records from two LINQ query or Results. We are using "Union" method of LINQ. In this example we combine or union records from two DataTable using LINQ. Here is example of this. In this example we execute two different LINQ Query on DataTable and find two different results object. After that we combine those records and display. Read More...
You can get Intersect of two LINQ query or Results. Intersect means find common records between two LINQ results. You can also say find duplicate records from two LINQ query or Results. In this example we find duplicate records from two DataTable using LINQ. Here is example of this. Read More...
XDocument is Introduce in System.Xml.Linq namespace. XDocument is more friendlier and easy to use than XMLDocument. Earlier we are using XMLDocument for read and processing XML File. Syntax of retrieving element from XML document is different than XMLDocument. Every .Net Beginners needs to know this. Read More...
You can also query the array variables using LINQ. Here are sample example for this. In this example there is an array of integer values which contains various number, Now we want to get numbers in array which is greater then 5. We can do this without FOR loop. There are two possible way to do this. One is using LINQ Query and Second is Using Predicate. Read More...
You can also query the text file using LINQ . Here are example for this. In this example we can get specific lines which has matching word given by us. After the LINQ query is executed you need to close file otherwise it gives error on next attempt to access of file. Read More...
Using LINQ you are able to fin common values amoung two arrays. There is a one method "Intersect" in LINQ to get intersect values. Here are sample example for this. In this example we have two arrays of integer and find common values of that arrays. Read More...
Using a group join you can get group wise data using LINQ. Here are sample example for this. In this example there are two classes Books and Publishers. Now we want to display Publisher wise books, One publishers has multiple books. We can do this using LINQ. Using a group join you can get all the publishers that match a books as a sequence. Read More...
Using LINQ you are able to sort array. Array may contains integer , string , double or char values. Here are sample example for this. In this example we have to arrays one is integer and second is string. Read More...
You can also do left outer join using LINQ. Here are sample example of this. In this example there is book class which has PublisherId field , this fields contains only numeric values. Read More...
Using LINQ to XML you can also join multiple files and get result based on LINQ query. LINQ to XML uses System.Xml.Linq namespace. Here are example for this. Read More...
You can also query the array variables using LINQ. Here are sample example for this. In this example there is an array of integer values which contains various number, Now we want to get numbers in array which is greater then 5. We can do this without FOR loop. Read More...
Using LINQ to XML we can use the same basic LINQ syntax to query XML documents. LINQ to XML uses System.Xml.Linq namespace. Here are example for this. In this example we have Books.xml file which contains books details. Now we query this xml files and display it's data in grid using LINQ . In LINQ to XML we have to provide mapping logic in LINQ query. Read More...
Using LINQ we can achive paging logic in your application much easier by exposing the Skip and Take methods. The Skip method enables you to skip a defined number of records in the resultset. The Take method enables you to specify the number of records to return from the resultset. By calling Skip and then Take, you can return a specific number of records from a specific location of the resultset. You can use Skip and Take methods Take method in any LINQ Query either Simple query or Joining Query. Read More...
LINQ also supports the joining of data from different collections using a familiar SQL-like join syntax. Here are sample example of this. In this example there is book class which has PublisherId field , this fields contains only numeric values. Read More...
LINQ also includes many operators you can execute on enumerable objects. Most of these operators are available to use and are similar to operators that you find in SQL, such as Count, Min, Max, Average, and Sum. Here are sample example of using this operators. Read More...
You can also perform Grouping in LINQ to Objects using a LINQ Query. This LINQ query uses the group keyword to group the Books data by pages. Additionally, because a group action does not naturally result in any output, the query creates a custom query projection using the techniques discussed earlier. Using LINQ to do this grouping enables you to significantly reduce the lines of code required. This is also improve the readability and clarity of the code. Read More...
You always need to filter the records based on certain fileds. Using LINQ query you are able to get this. Here are sample example for that. Read More...
An interesting feature of LINQ is its delayed execution behavior. Means that even though you may execute the query statements at a specific point in your code, LINQ is smart enough to delay the actual execution of the query until it is accessed. Read More...
You can also set data ordering and custom field name using linq query. Here are sample example for that. In this example Title and ISBN Column names changed to FullTitle and ISBNNumber, and data is order by Title in ascending. You can also set multiple column by comma like ", bl.ISBN". And also set fordescending order. Read More...
There are situations where you do not want all fields in LINQ query you want only selected fields. You can also say that Creating a custom projection with LINQ. Here are sample example for that. In this Example we only want Title and ISBN Fields. Read More...
Now a days LINQ is more popular for query. We can also query to object using LINQ. Here are sample example of select query LINQ To Objects. Read More...
If you want to get multiple selected items from listbox without using FOR loop using LINQ you can achieve that. Here are sample Example For this: Read More...
There are many situations where you want to convert List to List. Using Linq Method "ConvertAll" we can achieve in one sentence. LINQ Namespace is System.Linq . Here are sample Example For this: Read More...
No comments:
Post a Comment