回答編集履歴
2
修正
test
CHANGED
@@ -28,9 +28,9 @@
|
|
28
28
|
|
29
29
|
{
|
30
30
|
|
31
|
-
var name_x = Convert.ToString(x[
|
31
|
+
var name_x = Convert.ToString(x["Name"]);
|
32
32
|
|
33
|
-
var name_y = Convert.ToString(y[
|
33
|
+
var name_y = Convert.ToString(y["Name"]);
|
34
34
|
|
35
35
|
if ( name_x==name_y )
|
36
36
|
|
@@ -110,7 +110,7 @@
|
|
110
110
|
|
111
111
|
DataTable dt2 = dt.AsEnumerable()
|
112
112
|
|
113
|
-
.OrderBy(x => String.IsNullOrEmpty(x[
|
113
|
+
.OrderBy(x => String.IsNullOrEmpty(x["Name"].ToString()) ? "ZZZ" : x["Name"])
|
114
114
|
|
115
115
|
.CopyToDataTable();
|
116
116
|
|
1
追記
test
CHANGED
@@ -101,3 +101,17 @@
|
|
101
101
|
(実行結果)
|
102
102
|
|
103
103
|
![実行結果](4d6df264586ddb6eadde7ce791c65f55.png)
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
手抜きするなら、空白を絶対最後尾に来る文字列に置換するとか…
|
108
|
+
|
109
|
+
```cs
|
110
|
+
|
111
|
+
DataTable dt2 = dt.AsEnumerable()
|
112
|
+
|
113
|
+
.OrderBy(x => String.IsNullOrEmpty(x[1].ToString()) ? "ZZZ" : x[1])
|
114
|
+
|
115
|
+
.CopyToDataTable();
|
116
|
+
|
117
|
+
```
|