Powershell Studio | Connect a ComboBox to single Column Table in MSSQL

Welcome Forums General PowerShell Q&A Powershell Studio | Connect a ComboBox to single Column Table in MSSQL

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
2 months, 3 weeks ago.

  • Author
    Posts
  • #162990

    Participant
    Topics: 1
    Replies: 0
    Points: 12
    Rank: Member

    Hi, can anyone perhaps assist me, im using Powershell Studio from Sapien Technologies and am trying to connect a ComboBox drop down to a Single column MSSQL Table. I have no problem querying the table using Invoke-Sqlcmd with and out-string to console.

    I just cannot connect a ComboBox to populate with the table data for selection.

    #Example :

    ComboBox = Select Country

    SQL Table = "Countries" Single data Column with an ID Column for each country.

    When i run the script the Windows Form App opens and then ComboBox awaits select country to return string "Welcome to $Country"

    I cant get the ComboBox to populate with the countries from the SQL Table called "Countries"

    #End Example

    Can anyone assist pls?

  • #163110

    Participant
    Topics: 0
    Replies: 15
    Points: 61
    Helping Hand
    Rank: Member

    If you are able to query the table, store the output into an array.

    When you drag and drop a combobox item, it creates a function in the form called update-combobox

    Use that function to populate the combobox

    
    Update-ComboBox -ComboBox $nameofcomboBox -Items $arrayCountry
    
    

You must be logged in to reply to this topic.