Scenario: You are developing a Windows Forms application that needs to display and edit data from a database. Which ADO.NET component would you use to store and manage the data in a tabular format?
- SqlConnection
- SqlDataAdapter
- SqlDataReader
- DataTable
DataTable is the correct option. It represents one table of in-memory data. It can be used to store and manage data retrieved from a database or any other data source. SqlConnection is used to establish a connection to a database. SqlDataAdapter is used to populate DataTables with data from the database. SqlDataReader is used to read data from a database in a forward-only, read-only manner.
Loading...
Related Quiz
- In LINQ to Objects, what type of data source does it query?
- Which ADO.NET class is commonly used to execute non-query commands?
- DataAdapters are database-agnostic, allowing you to work with various database providers such as SQL Server, Oracle, and ___________.
- To retrieve different data types from a data reader, you can use the _______ method.
- What is the significance of setting the Nested property of a DataRelation to true?