Scenario: You are developing a WinForms application that needs to display a list of products from a database. Which control and data binding method would you use to achieve this?

  • DataGridView with DataSource property
  • ListBox with DataBinding event
  • ComboBox with DisplayMember property
  • DataGrid with Bind method
The correct option is DataGridView with DataSource property. DataGridView is a versatile control for displaying tabular data and supports data binding through its DataSource property, which allows you to easily bind it to a data source such as a DataTable or a list of objects. This control provides rich functionality for displaying and editing data in a grid format, making it suitable for displaying a list of products from a database.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *