To achieve this, i have added an Autoincrement Column to the DataTable so that i can use a filter on the Autoincrement Column to get the desired 20 records from the DataTable. I have used the following code
Expand|Select|Wrap|Line Numbers
- Dim dc As New DataColumn("Serial",System.Type.GetType("System.Int32"))
- dc.AutoIncrement = True
- dc.AutoIncrementSeed = 1
- dc.AutoIncrementStep = 1
- dt.Columns.Add(dc)
When i set the datasource of DataGridView to this DataTable, i see null values in the Serial Column
Question is:
How can i get the Autoincrement Column working (with values)
I can't query the database, all i have to do is play around with the available DataTable