Combo Box

[Migrated content. Thread originally posted on 21 April 2011]

What is the code to Add Items to Combobox on Visual Cobol. I'm RM-Cobol User, now I have to play with SQL DATA BASE, Can I gen one example how to create one file, how I can read it and Add it's records to ComboBox.
jose61@pryma.ws
Thanks for your help.
  • Verified Answer

    Hi,

    I e-mailed you an example program which will create a SQL table in a SQL Server database and then bind the data to a combobox control.

    The binding part is simple:

    set comboBox1::DataSource to wsDataset::Tables::Item("MFCustomers")
    set comboBox1::DisplayMember to "CompanyName"

    wsDataset will be an ADO.NET dataset which is filled with the rows of the MFCustomers data table.
    Simply set the DataSource property to the name of the table in the dataset.
    Set the DisplayMember property to the name of the column to bind to in the specified table.

    The rest of the sample shows how to use the EXEC SQL and EXEC ADO COBOL syntax to create a new table and then fill a dataset with its data.


    Let me know if you have any questions or if this isn't what you are looking for.