LinQ Tutorial on DataTable – C#

LinQ Tutorial

This LINQ tutorial will show you some basic codes on implementing LINQ in C#.LINQ is an acronym for Language Integrated Query, which is descriptive for where it’s used and what it does. The Language Integrated part means that LINQ is part of programming language syntax. To have an overall view of the definition of LINQ please refer to this site I find csharp-station.com. Below are basic codes for implementing LINQ on a DataTable.

For more tutorial visit this link ASP.NET MVC Developement.

CopyToDataTable();

Note:

  • Employee -> DataTable Name

Select  All

Note:

  • Employee -> DataTable Name

Select Specific column from DataTable

 

Note:

  • Name -> Table Column Name
  • Address -> Table Column Name
  • Employee -> DataTable Name

Count()

  Note:

  • Name -> Table Column Name
  • Address -> Table Column Name
  • Employee -> DataTable Name

 

Count();

 Note:

  • Name -> Table Column Name
  • Employee -> DataTable Name
  • data -> Variable

 

ToList()

Note:

  • Name -> Table Column Name
  • Address -> Table Column Name

SUM()

Note:

  • NUmberOfEmployee-> Table Column Name
  • data -> variable
  • Employee -> DataTable Name

Group BY & order by

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *