ADO.Net Interview Question and Answers
76. |
What is SqlDataAdapter Object? |
|
- The object takes the help of all the above objects to work with the underlying database.
-
It makes use of the connection object to establish connection with the database, uses the command object to execute Sql commands on the connected database.
|
|
|
77. |
What is the DataTableCollection? |
|
An ADO.NET DataSet contains a collection of zero or more tables represented by DataTable objects. The DataTableCollection contains all the DataTable objects in a DataSet. |
|
|
78. |
How would you connect to a database by using .NET? |
|
The connection class is used to connect a .NET application with a database. |
|
|
79. |
What are the different methods available under sqlcommand class to access the data? |
|
- ExecuteReader - Used where one or more records are returned - SELECT Query.
- ExecuteNonQuery - Used where it affects a state of the table and no data is being queried - INSERT, UPDATE, DELETE, CREATE and SET queries.
- ExecuteScalar - Used where it returns a single record.
|
|
|