How to keep the first three rows in datatable

I have to keep the first three rows in datatable and delete remaining rows

Hi,

Hope the following helps you.

dt = dt.Rows.Cast(Of DataRow).Take(3).CopyToDataTable

Regards,

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.