Hoppa till huvudinnehållet

How do you set the Order By property of the Query Task?

Kommentarer

10 kommentarer

  • Tom Neer
    Sean, you want to use:

     

      New System.Collections.Generic.List(Of ESRI.ArcGIS.Client.Tasks.OrderByField)({ New ESRI.ArcGIS.Client.Tasks.OrderByField([INSERTCOLUMNNAME], ESRI.ArcGIS.Client.Tasks.SortOrder.Ascending) })

     

     
    0
  • Sean McClurkan
    Thanks, Tom.  My co-worker just spotted that, too!
    0
  • Permanently deleted user
    Do you know the proper syntax to use in the expression manager in Workflow Designer for the order by fields property of the query task? Nothing I enter is working. I want to have it sort in ascending order on the ID field.

     

    User-added image

     

     
    0
  • Nico Burgerhart
    New System.Collections.Generic.List(Of ESRI.ArcGIS.Client.Tasks.OrderByField)({ New ESRI.ArcGIS.Client.Tasks.OrderByField("ID", ESRI.ArcGIS.Client.Tasks.SortOrder.Ascending) })

     

    Your ArcGIS Server should be 10.1 or higher.
    0
  • Permanently deleted user
    I assumed that was referring to the code in the xaml. Thanks Nico!  Worked perfectly. That's a good way to start a Monday :)
    0
  • Permanently deleted user
    what would be the syntax to order by two fields
    0
  • Kevin Penner
    New System.Collections.Generic.List(Of ESRI.ArcGIS.Client.Tasks.OrderByField)({ New ESRI.ArcGIS.Client.Tasks.OrderByField("ID", ESRI.ArcGIS.Client.Tasks.SortOrder.Ascending) }, { New ESRI.ArcGIS.Client.Tasks.OrderByField("ID2", ESRI.ArcGIS.Client.Tasks.SortOrder.Ascending) })

     

     
    0
  • Andrew Kan

    Hmm... this is not working for me. I'm able to sort by one field but not two. When I try the above to sort by two fields but I get an error - "Overload resolution failed because no accessible 'New' accepts this number of arguments".

     

    Thanks in advance.

    0
  • Nico Burgerhart

    There is a syntax error in the example of Kevin Penner.

    Try the following (Field en Field2 are the fieldnames)

    New System.Collections.Generic.List(Of ESRI.ArcGIS.Client.Tasks.OrderByField)({ New ESRI.ArcGIS.Client.Tasks.OrderByField("Field", ESRI.ArcGIS.Client.Tasks.SortOrder.Ascending), New ESRI.ArcGIS.Client.Tasks.OrderByField("Field2", ESRI.ArcGIS.Client.Tasks.SortOrder.Ascending) })

     

    0
  • Andrew Kan

    Thanks Nico! Problems solved now. Cheers

    0

Du måste logga in om du vill lämna en kommentar.