Hi,
I am trying to query a share point list in a ArcGIS Web Part. So I took the sample on line from the SDK and changed it so that it was pointing to my list and my list fields and I can't seem to get it to work.
I have put pop up windows in the code and it never seems to go to the on failure or on success functions it dies at
clientContext.ExecuteQueryAsync(onQuerySucceeded, onQueryFailed);
My X and Y fields I am using are number fields (I have also tried to use the ShapeX and ShapeY fields from a ArcGIS Geocode Workflow) and nothing seems to work.
I have taken the sample as is with the cities list and I have gotten the query by attribute to work that way.
private void StateComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ClientContext clientContext = ClientContext.Current;
Web web = clientContext.Web;
// Query the list "Cities" with the selected state name
List citiesList = web.Lists.GetByTitle("Test"); // My lists name is Test
CamlQuery camlQuery = new CamlQuery();
string stateName = StateComboBox.SelectedValue.ToString();
camlQuery.ViewXml =
@"<View>
<Query>
<Where>
<Eq>
<FieldRef Name='Title'/>
<Value Type='Text'>" + stateName + @"</Value>
</Eq>
</Where>
</Query>
<RowLimit>1000</RowLimit>
</View>";
citiesListItems = citiesList.GetItems(camlQuery);
clientContext.Load(citiesList, list => list.Title);
clientContext.Load(citiesListItems, items => items.Include(
item => item["X"],
item => item["Y"]
));
MapApplication.Current.ShowWindow("Ready to Execute", new TextBlock()
{
Text = "Ready to Execute. ",
TextWrapping = TextWrapping.Wrap,
Margin = new Thickness(30),
MaxWidth = 480
});
clientContext.ExecuteQueryAsync(onQuerySucceeded, onQueryFailed);
}