LINQ to DataSets - Ordering Operators


.NET Framework 4.0
LINQ to DataSets, Ordering Operators
Desktop
en-US
6/28/2011

Introduction

This sample shows different uses of Ordering Operators

Building the Sample

  1. Open the Program.cs
  2. Comment or uncomment the desired samples
  3. Press Ctrl + F5

Screenshot

Sample Code

C#
Edit|Remove
            public void DataSetLinq28() 
            { 
 
                var words = testDS.Tables["Words"].AsEnumerable(); 
 
                var sortedWords = 
                    from w in words 
                    orderby w.Field<string>("word") 
                    select w; 
 
                Console.WriteLine("The sorted list of words:"); 
                foreach (var w in sortedWords) 
                { 
                    Console.WriteLine(w.Field<string>("word")); 
                } 
            }

Source Code Files

More Information

For more information. see: