Skip to main content

Posts

Showing posts with the label datatable

Return top N rows from datatable

Normally to return top N rows we use an SQL statement similar to the one below Select top N * from table but How can we achieve the same thing in DataTable I have seen many examples, using different methods. Most of the methods centered around the idea of creating new columns with automatic values increment and using them as index  There is better method using LINQ