When I use tool zonalstatistics as table or zonstatistics in ArcToolBox 10.1,I can get the result without error.But when I use C# and IZonalOp.ZonalStatisticsAsTable( or pZonalOp.ZonalStatistics ) in ArcObjects 10.1,There are error as follows:ERROR 010316: Unable to open the input raster: C:\USERS\ADMINI~1\APPDATA\LOCAL\TEMP\G_G722ERROR 010067: Error in executing grid expression.I have read many posts,but no one can...:(My codes are listed as follows.Help Me!
ISurfaceOp2 pSurfaceOp = new RasterSurfaceOpClass();
object Missing = Type.Missing;
IRasterDataset rasterDataset = default(IRasterDataset);
rasterDataset = pdemWorkspace.OpenRasterDataset(demName);//"SDE.Slope_SDE1"
IGeoDataset pdemGeoDs = (IGeoDataset)rasterDataset;
IGeoDataset pOutputRaster = pSurfaceOp.Slope(pdemGeoDs, esriGeoAnalysisSlopeEnum.esriGeoAnalysisSlopeDegrees, ref Missing);//ç??æ??å?¡åº¦å?¾generate a slope map
IFeatureClass pgridfeatClass = default(IFeatureClass);
pgridfeatClass = pgridWorkspace.OpenFeatureClass(gridName);
IGeoDataset pgridDs = pgridfeatClass as IGeoDataset;
IZonalOp pZonalOp = new RasterZonalOpClass();
ITable pTable = pZonalOp.ZonalStatisticsAsTable(pgridDs, pOutputRaster, true);//Error occurs