Scenario: You need to display a list of products from a database, and you want full control over the HTML markup for each product item. Which ADO.NET control would you choose, and why?
- DataList
- GridView
- ListBox
- Repeater
The Repeater control in ADO.NET would be the optimal choice for this scenario. It offers the highest level of flexibility in defining the HTML markup for each item in the list. Unlike other controls like DataList or GridView, the Repeater control does not impose any predefined structure on the output, allowing you to have full control over the generated HTML. This makes it ideal for scenarios where custom HTML markup is required, such as displaying products with specific styling or layout requirements.
Loading...
Related Quiz
- In WinForms, which event is often used to trigger data binding updates?
- Scenario: Your application needs to allow users to edit data within the displayed table. Which property or feature would you enable in the chosen control?
- In ADO.NET, what are the different ways to call a stored procedure?
- You have a LINQ query that performs multiple joins and retrieves a large dataset. What steps can you take to optimize the query's performance?
- When binding data to a list control, which ADO.NET class is commonly used?