This is a sample task for the ESRI Web ADF. It extends the standard QueryAttributesTask so that every feature is selected (and highlighted on the associated Map control) immediately when the task executes.
To use, unzip the solution/project to your hard disk, and open the .sln file in Visual Studio 2005. You may also use Visual VB Express to open the project. For details on using the task, see the ESRI ArcGIS Server Developer blog entry for this sample, from February 2006.