Skip to main content

Populate ComboBox From SQL Query

Comments

3 comments

  • Permanently deleted user

    SQLQuery returns a Results which type is DataTable. 

    Results

    The results of the query as a DataTable.

     

    if you assign the Results as a variable named as 'dt'.

    Use Assign activity: dt.TableName = 'Any name'

    http://msdn.microsoft.com/en-us/library/system.data.datatable.tablename.aspx

     

     

    0
  • Robert Pincus

    That worked.

    What I did was to add an Assign tool between the SqlQuery and DataTableToDataItemList tools.

    I set the datatable name like this dtResults.TableName = "foo"

    Then set the dtResults to variable iDataItems in the DataTableToDataItemList.

    Finally bind the ComboBox to iDataItems.

     

    Thanks,

    Robert

    0
  • Permanently deleted user
    Robert, I realize this was a very long time ago, but I am having trouble with that last step, to bind the combo box to the DataItemList.  I have a runtime process which creates a combobox on the fly and populates the list from the results of a SQL query.  I have created the DataItemList from the SQL query results, but I can't figure out how to set the combobox to use the dataitemlist.
    0

Please sign in to leave a comment.