Add Layer from Database or Datatable to Basemap using Esri.ArcGISRuntime in C#

1226
3
01-18-2021 12:06 AM
AnsarTharammal
New Contributor
How can I add/create Layer using Datatable or Database Query in C#.net instead adding through Uri using Esri.ArcGISRuntime sdk for wpf?
0 Kudos
3 Replies
MichaelBranscomb
Esri Frequent Contributor

You can use either a GraphicsOverlay or a FeatureCollectionLayer to display a layer from a database/datatable. I've summarized some of the key differences below. 

GraphicsOverlay:

FeatureCollectionLayer:

For more information see:

Tutorials:

For a larger example see: https://github.com/Esri/arcgis-runtime-demos-dotnet/tree/main/src/GeoEventServerSample

AnsarTharammal
New Contributor

But above mentioned links or samples doesn't shows how to create layer with the data from a database. And also I need to select any point/location from the generated layer to show popups with details of that point.

Can you provide me some sample code.?

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

In the examples above you will write code to query the database/datatable then create features or graphics with geometry, attributes, and a renderer. These examples assume relatively low volumes of data, e.g. 1000s or 10,000s of features/graphics because you will retrieve all the records in one query and add them to the map view.

For larger volumes of data where you want to retrieve data from the database based on a spatial queries. for example as the user pans or zooms the map view, a spatially enabled database and a feature service are recommended. For more information see https://pro.arcgis.com/en/pro-app/latest/help/sharing/overview/introduction-to-sharing-web-layers.ht....

0 Kudos