Select to view content in your preferred language

Problem with featureLayer Where clause

2584
3
03-16-2012 10:09 AM
DonFreeman
Emerging Contributor
Hi - I have a featureLayer using SDE features with SQL attributes. One of the attributes 'Archived' is a bit field 0/1. I want to display only the features where Archived = 0 on one layer and those with Archived=1 on a second layer. My where clause (Where="PAGsde.dbo.Projects.Archived = 0") shows ALL the features and (Where="PAGsde.dbo.Projects.Archived = 1") shows no features. I must have the syntax wrong. Can someone help me? My code:
<esri:FeatureLayer ID="ProjectLines"
       DisableClientCaching="False" 
       Url="http://gismaps.pagnet.org/ArcGIS/rest/services/TIPProjects/MapServer/1"
       OutFields="*"
       Renderer="{StaticResource LinesRenderer}"
       Where="PAGsde.dbo.Projects.Archived = 0"
       MouseLeftButtonUp="FeatureLayer_MouseLeftButtonUp"
       UpdateCompleted="FeatureLayer_UpdateCompleted"
       >
       <esri:FeatureLayer.MapTip>
        <Border CornerRadius="10" BorderBrush="SaddleBrown" BorderThickness="3" Margin="0,0,15,15" Background="LightGray">
         <StackPanel Margin="7">
          <StackPanel Orientation="Horizontal">
           <TextBlock Text="Project: " Foreground="Black" FontWeight="Bold"/>
           <TextBlock Text="{Binding [PAGsde.dbo.Projects.TipID]}" Foreground="Black" />
           <TextBlock Text=" - " Foreground="Black" FontWeight="Bold"/>
           <TextBlock Text="{Binding [PAGsde.dbo.Projects.ProjectName]}" Foreground="Black" />
          </StackPanel>
         </StackPanel>
        </Border>
       </esri:FeatureLayer.MapTip>
      </esri:FeatureLayer>

Thanks
0 Kudos
3 Replies
DarinaTchountcheva
Frequent Contributor
Don,

Try Where="PAGsde.dbo.Projects.Archived = 'False'" and Where="PAGsde.dbo.Projects.Archived = 'True'"
0 Kudos
DonFreeman
Emerging Contributor
Don,

Try Where="PAGsde.dbo.Projects.Archived = 'False'" and Where="PAGsde.dbo.Projects.Archived = 'True'"


Yep. I had already tried those. They both produce NO features.
0 Kudos
DonFreeman
Emerging Contributor
All -

I reworked the service to join to the attribute table in sql and not it works OK.
Thanks for your interest.
0 Kudos