@@ -41,8 +41,11 @@ class Program
4141{
4242 static void Main ( string [ ] args )
4343 {
44- Q912a ( ) ;
45- Q912b ( ) ;
44+ Issue918 ( ) ;
45+ return ;
46+
47+ Issue912a ( ) ;
48+ Issue912b ( ) ;
4649 return ;
4750
4851 Json ( ) ;
@@ -68,7 +71,33 @@ static void Main(string[] args)
6871 Dynamic ( ) ;
6972 }
7073
71- private static void Q912a ( )
74+ private static void Issue918 ( )
75+ {
76+ var persons = new DataTable ( ) ;
77+ persons . Columns . Add ( "FirstName" , typeof ( string ) ) ;
78+ persons . Columns . Add ( "Nickname" , typeof ( string ) ) ;
79+ persons . Columns . Add ( "Income" , typeof ( decimal ) ) . AllowDBNull = true ;
80+
81+ // Adding sample data to the first DataTable
82+ persons . Rows . Add ( "alex" , DBNull . Value , 5000.50m ) ;
83+ persons . Rows . Add ( "MAGNUS" , "Mag" , 5000.50m ) ;
84+ persons . Rows . Add ( "Terry" , "Ter" , 4000.20m ) ;
85+ persons . Rows . Add ( "Charlotte" , "Charl" , DBNull . Value ) ;
86+
87+ var linqQuery =
88+ from personsRow in persons . AsEnumerable ( )
89+ select personsRow ;
90+
91+ var queryableRows = linqQuery . AsQueryable ( ) ;
92+
93+ // Sorted at the top of the list
94+ var comparer = new DataColumnOrdinalIgnoreCaseComparer ( ) ;
95+ var sortedRows = queryableRows . OrderBy ( "FirstName" , comparer ) . ToList ( ) ;
96+
97+ int xxx = 0 ;
98+ }
99+
100+ private static void Issue912a ( )
72101 {
73102 var extractedRows = new List < SalesData >
74103 {
@@ -97,7 +126,7 @@ private static void Q912a()
97126 int x = 9 ;
98127 }
99128
100- private static void Q912b ( )
129+ private static void Issue912b ( )
101130 {
102131 var eInfoJoinTable = new DataTable ( ) ;
103132 eInfoJoinTable . Columns . Add ( "Region" , typeof ( string ) ) ;
0 commit comments