none
Problem populating cascading combo boxes from data table (imported rows)? RRS feed

  • Question

  • Hallo,

    My application has cascading combo boxes (adopted a code given by Herr Peter Fleischer) and the selected values from the combo boxes are saved to data table and i export my dataset as XML. 

    if i read back this XML, all the cascading boxes works perfectly fine without any problem as they should. but if i separately import rows from the XML to data table , combox boxes are not populated why is that ? any idea why is not populating from data table?

    cascading combobox code 

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/b2aa567b-8b7a-47ff-939e-40c630402896/add-combo-box-selected-value-to-data-table?forum=vbgeneral

    import row somthing like this

    For Each dr As DataRow In sourceTable.Rows
        r = destinationTable.NewRow
        r("Name") = dr("Name")
        r("City") = dr("City")
        r("Cost") = dr("Cost")
        destinationTable.Rows.Add(r)
    Next 

    Thanks

    Sunday, September 8, 2019 8:08 AM

All replies

  • If what Peter provided worked and what you have does not this has to be data related, not code related which means you would need to verify there are valid data for the relations.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Sunday, September 8, 2019 10:45 AM
    Moderator
  • If what Peter provided worked and what you have does not this has to be data related, not code related which means you would need to verify there are valid data for the relations.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    I may have found the problem. When i import my XML to dataset , i am missing a column which contains one of the relationship for the combobox. I dont know why this column is missing? . Do i have to define all columns before reading XML with Dataset.ReadXmL(filename)?. 

    I just declare dataset and using Dataset.ReadXmL(filename). Is it ok?

    Sunday, September 8, 2019 2:58 PM
  • Ok i solved it . That missing column was the problem because it was empty and did not show up in the xml.
    Sunday, September 8, 2019 4:03 PM
  • Hi,

    I am glad you have got your solution, we appreciated you shared us your solution, we also hope you can mark it as an answer. If so, you will help others find the answer faster.

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, September 9, 2019 7:27 AM