O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Questions That Should Be Asked More Frequently

Q

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?

A

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required