• combobox (VB.NET 2005)

    Home » Forums » Developers, developers, developers » DevOps Lounge » combobox (VB.NET 2005)

    Author
    Topic
    #433273

    Second day getting to know vb .net. Not a good experience. Can someone tell me what are the steps that i need to take to bind listbox to a lookup table. I have created a form which is based on tblABC. A textbox on the form is based on another lookup table. The form displays contents of fields correctly however, the dropdown part of the combo is empty. What do I need to do to make sure that the combobox display the correct field content and also retrieve the items from the lookup table when my users press the down arrow on the combobox.

    Viewing 0 reply threads
    Author
    Replies
    • #1018775

      Can you provide some details as to your data access setup? When you mention the lookup table, is this in a database or is it a DataTable object (part of a DataSet)?

      • #1018780

        umm..i am not sure. but i have a dataset which based on a table on the sql server. the lookup table is also on the server.

        • #1018800

          Tried this and tried that. It finally works. Have to make sure the bindingsource fot the lookup table is included, set the datasource, binding source…bla.bla.bla. But it works

          • #1018821

            I haven’t spent the time to get up to speed with .NET 2.0 (2005) yet. But the way I would do this in 1.1 (2003) would be to populate the dataset (usually using a Data Adapter to get the data from the data source), set the Data Source of the drop-down to the desired table in the dataset (usually DataSet.Tables[0]) then bind the drop-down (DropDown.DataBind()).

            Hope this helps!

    Viewing 0 reply threads
    Reply To: combobox (VB.NET 2005)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: