Hoppa till huvudinnehållet

Kommentarer

4 kommentarer

  • Berend Veldkamp
    You are trying to cast the datatable returned by the SqlQuery activity to some sort of enumerable object, which is not possible.

     

    Instead, loop over the rows property and get the values from there.

     

    User-added image
    • Make sure System.Data and System.Xml is added to the list on the Import tab
    • The For Each activity loops over datatable1.Rows.OfType(Of DataRow)
    • The Add To Collection activity adds "'" & CStr(row.Item(0)) & "'" to a variable of type List(Of String) named values
    • The value assigned to filter is "Location in (" & String.Join(",", values) & ")"

     

     
    0
  • Permanently deleted user
    Thanks so much for the detailed response.

     

    I am unable to populate the AddtoCollection code though. Are you able to see my error? Have I used the wrong "List(Of String)" type? 

     

    User-added image
    0
  • Berend Veldkamp
    Your screenshot is barely readable, but I think you can spot the difference yourself if you look closely.

     

    Compare

     

    AddToCollection<String>

     

    To

     

    AddToCollection<List<String>>
    0
  • Permanently deleted user
    thank-you!
    0

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