Does A dataTable.Rows.Count Get Evaluated On Each Loop?
I just wonder if I do something like
for (int i = 0; i < dataTable.Rows.Count; i++)
Does array.Count get revaluated on each iteration?
The reason I ask is becua开发者_StackOverflow中文版se if I delete rows from that datatable will that cause problems?
Yes, it does get evaluated each time, but you really shouldn't be changing the number of elements you are iterating through like that.
精彩评论