1. Convert the datatable to Enumerable.

2. Then select the field (column) using the lamda expression to get the column.

3. Then use the First() operator to get the first row in the specified column filtered by the Column name

lblCaseShow.Text = dtCoverPage.AsEnumerable().Select(s => s.Field<string>("Case caption")).First().ToString();

lblCompexOrderNoShow.Text = dtCoverPage.AsEnumerable().Select(s => s.Field<string>("OrderNo")).First().ToString();

Advertisements