USForestServiceAdmin

Remove selection from file geodatabase layer

Discussion created by USForestServiceAdmin on Feb 15, 2012
Latest reply on Feb 17, 2012 by USForestServiceAdmin
Hello all,

I am trying to remove a selection from a file geodatabase layer.  The following code is bombing out.  Any ideas? 

Thx in advance

           Try

                'Set up the geoprocessor to do the spatial select
                gp = New GeoProcessor
                Dim strNewParam As IVariantArray = New VarArray
                gp.OverwriteOutput = True
                gp.SetEnvironmentValue("Workspace", m_gdbPath)

                MsgBox(m_strLayerName)
                MsgBox(pNewFLayer.Name)

                'set the parameters for the spatial select
                strParam.Add(m_strLayerName)
                strParam.Add("ARE_IDENTICAL_TO")
                strParam.Add(pNewFLayer.Name)
                strParam.Add("")
                strParam.Add("")
                strParam.Add("REMOVE_FROM_SELECTION")


                'execute the select by layer tool
                Dim newResults As IGeoProcessorResult = CType(gp.Execute("SelectLayerByLocation_Management", strParam, Nothing), IGeoProcessorResult)
                If newResults.Status <> ESRI.ArcGIS.esriSystem.esriJobStatus.esriJobSucceeded Then
                    MsgBox("Failed to remvoe selection using select by layer!", MsgBoxStyle.Information, "frmSelectLayer_btnRun_click")
                    results = Nothing
                    gp = Nothing
                    Exit Sub
                End If
                gp = Nothing



            Catch ex As Exception
                MsgBox(ex.StackTrace)
                MsgBox(ex.Message)

            End Try

Outcomes