The 'Add Shapefile' sample adds the shapefile to the map as a feature collection based feature layer. These layers do not support queries that need to be performed on the server - this includes queries with a where clause or non-extent based spatial queries. See the API Reference for more details: http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#FeatureLayer/FeatureLayerConst2