@Jim
I don't agree on the above statistics and I don't agree on your comment on my code. Why?
First, It seems the one who made this statistics like the slow motion activity because he didnot mentioned "Speed and performance". Where I will use code written in machine language (01) in my project if it proves its faster by > 20% from a code that easy to maintain.
Second, my code is simple to people who use alot of database manipulation
Third, I made a test on a SQL Server table I had, I get 10,000 rows where I have 2477 rows has p_fcat = 10 and tried these both codes
Me.dataGridView1.DataSource = DT1
Dim sw As New Stopwatch
sw.Start
DT1.AsEnumerable.Where(Function(f) f("p_fcat") = 10).ToList.ForEach(Sub(s) s.Delete)
sw.Stop
Dim ts As TimeSpan = sw.Elapsed
Button4.Text = ts.Minutes.ToString + ":" + ts.Seconds.ToString + ":" + ts.Milliseconds.ToString
result = 0:0:480
dataGridView1.DataSource = dt2
Dim sw As New Stopwatch
sw.Start
For i As Integer = dt2.Rows.Count - 1 to 0 Step -1
Dim value = dt2(i)("p_fcat")
If value = 10 Then
dt2.Rows.Remove(dt2.rows(i))
End If
Next
sw.Stop
Dim ts As TimeSpan = sw.Elapsed
Button5.Text = ts.Minutes.ToString + ":" + ts.Seconds.ToString + ":" + ts.Milliseconds.ToString
result : 0:2:459
Lambada is faster than loop by 5 times
I will chose Lambada in my projects if I don't know anything about it even if I don't understand how it work (but I do :) )