Select to view content in your preferred language

Get Query-string from Layer in mxd ?

1039
5
09-29-2010 10:59 PM
mariuskolleck
Occasional Contributor
Hi!

Can someone explain me how i can read an existing querydefinition
from a featurelayer ? i only figured out how to set it 😞

Thanks you !
0 Kudos
5 Replies
mariuskolleck
Occasional Contributor
ok, figured it out myself, wasn't that hard...

      
 If (TypeOf pLayer Is IFeatureLayer) Then
            Dim lay As IFeatureLayer
            Dim qu As String
            lay = CType(pLayer, IFeatureLayer)
            Dim def As IFeatureLayerDefinition = lay
            qu = def.DefinitionExpression
            Console.WriteLine(qu)
        End If
0 Kudos
mariuskolleck
Occasional Contributor
thanks ! the example was pretty helpfull.

one question more, is there a possibility to apply the
filter on the featuretofeilgeodatabase conversion tool ?
or how can i just convert those features which apply to
a query ?
0 Kudos
ThavitinaiduGulivindala
Regular Contributor
Hi,
If you are using any Tool from Toolbox in ArcMap, tool is executed only on selected records in the Layer, if any. Otherwise, the same is executed on all the records.
0 Kudos
mariuskolleck
Occasional Contributor
Sry, i didn't mention i was using the .NET API.
I am using the toolbox tool FeaturetoFileGeodatabase via .NET.

But it copies all layers from the mxd, but unfortunately with all
datasets, even those which are not used, because my sql query for
this layer takes them out.

My question is now, if there is a possibility to select those datasets which
are ment to be copied, or do i have to copy all, and take out those, which
i don't want in the finished filegeodatabase ?!? 🙂

thanks for your patience !
0 Kudos