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

Viewing 1 reply thread
  • 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: 28
      Points: 144
      Helping Hand
      Rank: Participant

      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
      
      
Viewing 1 reply thread
  • The topic ‘Powershell Studio | Connect a ComboBox to single Column Table in MSSQL’ is closed to new replies.