To query a DataTable using LINQ in C# and VB.NET you can use the snippet below.
In order to use the snippet, you need to reference System.Data.DataSetExtensions.
Sample C#
var resultData = (from myDataRow in myDataTable.AsEnumerable() where myDataRow.Field<Int32>("Fieldname") == 1 select myRow);
Sample VB.NET
Dim resultData = (From myDataRow In myDataTable.AsEnumerable() Where myDataRow.Field(Of Int32)("Fieldname") = 1myRow)
RT @CodeSnippetsNET: How to query a DataTable using #LINQ in C# and #VB .NET http://t.co/g8t3atb6t3 #visualbasic #csharp #dotnet #programmi…
RT @CodeSnippetsNET: How to query a DataTable using #LINQ in C# and #VB .NET http://t.co/g8t3atb6t3 #visualbasic #csharp #dotnet #programmi…
RT @CodeSnippetsNET: How to query a DataTable using #LINQ in C# and #VB .NET http://t.co/g8t3atb6t3 #visualbasic #csharp #dotnet #programmi…