Is there a way to retrieve data from Service table (not featuretable or layer) in WPF (.NET SDK 100.0.0)?

721
1
Jump to solution
02-19-2017 07:40 AM
EmilEMG
New Contributor

I have published a service. I can get data from feature layers but i can not find a way to get information from layers with Type: Table.

0 Kudos
1 Solution

Accepted Solutions
AnttiKajanus1
Regular Contributor II

If you have a table you can point ServiceFeatureTable to that and use QueryAsync to retrieve the data.

var serviceUri = new Uri("url to the table");
ServiceFeatureTable requestsFeatureTable = new ServiceFeatureTable(serviceUri);
requestsFeatureTable.FeatureRequestMode = FeatureRequestMode.OnInteractionCache;
await requestsFeatureTable.LoadAsync();
var results = await requestsFeatureTable.QueryFeaturesAsync(
    new QueryParameters() { WhereClause = "1=1" }, QueryFeatureFields.LoadAll);
var firstRequest = results.First();

View solution in original post

1 Reply
AnttiKajanus1
Regular Contributor II

If you have a table you can point ServiceFeatureTable to that and use QueryAsync to retrieve the data.

var serviceUri = new Uri("url to the table");
ServiceFeatureTable requestsFeatureTable = new ServiceFeatureTable(serviceUri);
requestsFeatureTable.FeatureRequestMode = FeatureRequestMode.OnInteractionCache;
await requestsFeatureTable.LoadAsync();
var results = await requestsFeatureTable.QueryFeaturesAsync(
    new QueryParameters() { WhereClause = "1=1" }, QueryFeatureFields.LoadAll);
var firstRequest = results.First();