none
Database, DataSet and ListBox RRS feed

  • Question

  • I tried the binding of DataSet and Database.

    And I tried the binding of ListBox and DataSet.

    However I'm not sure those(Database/DataSet/ListBox) are bounded and synchronized in edit/add/remove perfectly and efficiently.

    Isn't there any limitation?


    Tuesday, September 24, 2019 8:50 PM

Answers

  • Hello,

    Since a ListBox has no capabilities to perform data centric operations this would not be a good choice for data binding to a database. Using a ListView is a step better yet you must write a fair amount of code as you don't bind to data.

    Depending on specific types of operations better choices are to

    • Use a DataGridView
    • Use a DataGridView and controls such as DateTimePicker, TextBox etc as they can be bound to columns in a container like a DataTable in a DataSet.
    • Just TextBoxes and similar controls as per last bullet.

    In regards to syncing, typically this is done via a DataAdapter (some use TableAdapter which I'm strongly against TableAdapters).


    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

    Tuesday, September 24, 2019 9:08 PM
    Moderator