Using QueryBuilder dialog with raster files

Discussion created by on May 31, 2012
Latest reply on Jun 26, 2012 by CWang-esristaff
I'm using the built in QueryBuilder dialog to design my 'where' clauses with shapefiles. This code works great for me:
                IQueryBuilder queryBuilder = new QueryBuilder();
                String whereClause = String.Empty;
                String fullPath = "C:\\Test\\Shapefile.shp";

                String path = Path.GetDirectoryName(fullPath);
                String filename = Path.GetFileName(fullPath);

                // Set up the Shapefile query
                IWorkspaceFactory workspaceFactory = new ShapefileWorkspaceFactory();
                IWorkspace workspace = workspaceFactory.OpenFromFile(path, 0);

                IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspace;
                IFeatureClass featureClass = featureWorkspace.OpenFeatureClass(filename);

                ESRI.ArcGIS.Carto.IFeatureLayer featureLayer = new ESRI.ArcGIS.Carto.FeatureLayer();
                featureLayer.FeatureClass = featureClass as IFeatureClass;

                ESRI.ArcGIS.Carto.ILayer layer = featureLayer;
                queryBuilder.Layer = layer;
                queryBuilder.WhereClause = whereClause;


Now I'd like to do the same but with using a raster file. After several hours of investigating, I haven't found the magic solution. Any ideas?