ADO.NET INTERVIEW QUESTION & ANSWERS
86. |
What keyword is used to accept a variable number of parameter in a method? |
|
params keyword is used as to accept variable number of parameters. |
87. |
What type of data model does an OleDbCommand object fill? |
|
An ADODataReader object. |
88. |
Does an OleDbCommand object need to be closed? |
|
No, only the OleDbDataReader and OleDbConnection object need to be closed explicitly. |
89. |
What are the major components of data provider? |
|
- The Connection object which provides a connection to the database
- The Command object which is used to execute a command
- The DataReader object which provides a forward-only, read only, connected recordset
- The DataAdapter object which populates a disconnected DataSet with data and performs update
|
90. |
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(a single value normally) – SQL Functions like MIN(), NAX()
|