城市記憶
開發過程memo
2019年8月23日 星期五
[C#] datatable 刪除row
foreach
(DataRow dr
in
dt.Rows)
{
if
((
int
)dr[
"ID"
] > 5)
dr.Delete();
}
修改成
foreach
(DataRow dr
in
dt.Select(
""
))
{
if
((
int
)dr[
"ID"
] > 5)
dr.Delete();
}
http://codingcramp.blogspot.com/2014/10/collection-was-modified-enumeration.html
較新的文章
較舊的文章
首頁
訂閱:
文章 (Atom)