out_UpdatedDT=out_HistoricalDT.AsEnumerable().GroupBy(Function(i) i.Field(Of String("Contract")).Select(Function(g)g.First).copytodatatable

Here HistoricalDT is a datatable(from excel) containing rows with Contract as one of the column. This removes any duplicate Contract rows.

but what is Function(i)i.Field and (Function(g)g?