I want to return the top 5 records of a table in a dataset for datagrid view. The following does not work.
DataGridView.DataSource = DS.Tables("TABLENAME").Select("SELECT TOP 5")
If the dataset is already populated, you can use LINQ to take the first 5 rows from a table. (The more efficient method would be to handle this at the database, however.)
Dim rows = DS.Tables("Foo").Rows.Cast(Of DataRow)().Take(5)