List geodatabase versions

View inAndroidFormsUWPWPFWinUIiOSView on GitHubSample viewer app

Connect to a service and list versions of the geodatabase.

Image of list geodatabase versions

Use case

As part of a multi-user editing scenario, you can check with the server to see how many versions of the geodatabase are outstanding before syncing.

How to use the sample

When the sample loads, a list of geodatabase versions and their properties will be displayed.

How it works

  1. Create a geoprocessing task referring to a GPServer with a ListVersions task.
  2. Use the task to create default parameters.
  3. Use the created parameters to create a job.
  4. Run the job to get a GeoprocessingResult.
  5. Get a list of geoprocessing features from the Versions output parameter of the results.
  6. Format the geodatabase versions for display.

Relevant API

  • GeoprocessingFeatures
  • GeoprocessingFeatures.Features
  • GeoprocessingJob
  • GeoprocessingJob.GetResultAsync
  • GeoprocessingParameters
  • GeoprocessingResult
  • GeoprocessingResult.Outputs
  • GeoprocessingTask
  • GeoprocessingTask.CreateDefaultParametersAsync
  • GeoprocessingTask.CreateJob

About the data

The sample uses a sample geoprocessing service hosted on ArcGIS Online.

Additional information

ArcGIS Server does not include a geoprocessing service for listing geodatabase versions. You must configure one using the steps defined in Geoprocessing service example: list, create, and delete geodatabase versions in the ArcMap documentation.

Tags

conflict resolution, data management, database, multi-user, sync, version

Sample Code

ListGeodatabaseVersions.xamlListGeodatabaseVersions.xamlListGeodatabaseVersions.xaml.cs
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<UserControl x:Class="ArcGISRuntime.WPF.Samples.ListGeodatabaseVersions.ListGeodatabaseVersions"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0"
                       HorizontalAlignment="Center"
                       Text="Current versions" />
            <TextBox x:Name="ResultView"
                     Grid.Row="1"
                     ScrollViewer.VerticalScrollBarVisibility="Visible"
                     TextWrapping="Wrap" />
        </Grid>
        <Grid x:Name="BusyOverlay"
              Grid.RowSpan="4"
              Background="#8C000000"
              Visibility="Collapsed">
            <Border Padding="10"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Background="#FFC6C4C4">
                <Grid>
                    <ProgressBar x:Name="Progress"
                                 Height="20"
                                 IsIndeterminate="True" />
                    <TextBlock Height="Auto"
                               Margin="5"
                               HorizontalAlignment="Left"
                               Text="Getting versions from the geoprocessing task..." />
                </Grid>
            </Border>
        </Grid>
    </Grid>
</UserControl>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.