How can I use ADO.NET features to generate a distinct list of values? I know I can use the DataTable’s Select method or the DataView’s RowFilter property to apply filters like "Country = ‘Spain’" and I can use either feature to list values for the corresponding rows, but in each case the resulting list of values can contain duplicates. Is there any way to use ADO.NET to generate lists that omit duplicate values?
The DataView class’s new ToTable method is designed to help you handle this scenario, which we covered earlier in the chapter. I’ve spoken with a number of developers who hadn’t noticed the new method and/or did not realize it could be used to generate distinct values, so I figured it was ...