Saturday, 13 April 2019

30 - ADO.Net - multiple choice questions

1. DateSet contains one or more DataTables?
A. True
B. False
C. Can't say
D. None of the above

---------------------------------------------------------------------


2. Can we use DataView to Filter rows in a DataTable?

A. Yes by setting Filter property
B. Yes by setting FilterRow property
C. Yes by setting the SetFilter method
D. None of the above

---------------------------------------------------------------------


3. Which method is used to retrieve the single value?

A. ExecuteScalar
B. ExecuteReader
C. ExecuteSingle
D. ExecuteNonQuery

---------------------------------------------------------------------


4. How to load XML in DataSet?

A. Using the ReadXml method
B. Using the GetXml method
C. Both of the above
D. None of the above

---------------------------------------------------------------------


5. Which method is used to fill DataSet?

A. Populate
B. Fill
C. Open
D. Close

---------------------------------------------------------------------


6. Which object is used to Fill DataSet using the query in SQL Server?

A. DataSet
B. DataTable
C. DataAdapter
D. None of the above

---------------------------------------------------------------------


7. Which object will be used to sort the data of DataSet?

A. DataView object
B. DataSet
C. DataTable
D. DataAdapter

---------------------------------------------------------------------


8. DataSet object is

A. disconnected
B. connected
C. Can't say
D. None of the above

---------------------------------------------------------------------


9. Which is Read-only forward-only recordset?

A. DataSet
B. DataReader
C. DataAdapter
D. DataCommand

---------------------------------------------------------------------


10. Which namespace is used to fetch data from Oracle database?

A. Sql.Data
B. Sql.Data.SqlClient
C. Sql.Data.OracleClient
D. None of the above

---------------------------------------------------------------------


11. Which ADO.net object is very fast to get data from the database?

A. SqlDataAdapter
B. DataSet
C. SqlDataReader
D. None of the above

---------------------------------------------------------------------


12. What is the default specified timeout period for "SQLCommand.CommandTimeout" property?

A. 30 seconds
B. 60 Seconds
C. 90 Seconds
D. 120 Seconds

---------------------------------------------------------------------


13. What is the Full form of ADO.Net?

A. Active Display Object
B. ActiveX Data Object
C. Asp Data Object
D. Active Dot Object

---------------------------------------------------------------------


14. Which Adapter is used to get the data from the Access Database?

A. DataAdapter
B. OledbDataAdapter
C. SQLDataAdapter
D. OracleDataAdapter

---------------------------------------------------------------------


15. Which ADO.Net class provides a connected environment?

A. DataSet
B. DataReader
C.Both
D. None

---------------------------------------------------------------------


16. When to use the OleDbConnection object?

A. When we want to connect to the Oracle database.
B. When we want to connect to the Sql server database
C. When we want to connect to Office Access database
D. None of the above

---------------------------------------------------------------------


17. Which is the return type of the ExecuteScalar class?

A. System.Int32
B. object
C. Both
D. None of the above

---------------------------------------------------------------------


18. Which are command object methods?

A. ExecuteScalar
B. ExecuteNonQuery
C. ExecuteReader
D. All of the above


---------------------------------------------------------------------

19. Which of the following is not the method of DataAdapter

A. Fill
B. FillSchema
C. ReadDate
D. Update

---------------------------------------------------------------------


20. Which of the following is the benefit of the ADO.Net?

A. Interoperability
B. Disconnected Data Access
C. Store Data in multiple tables
D. All of the above

---------------------------------------------------------------------


21. ADO.Net provides the ability to process and create an in-memory database which is called

A. DataSets
B. Views
C. Tables
D. Relations

---------------------------------------------------------------------


22. It is not required to open the connection when I am using DataAdapter.

A. True
B. False

---------------------------------------------------------------------


23. Which CommandType is used to define the StoredProcedure?

A. Command.TableDirect
B. CommandType.StoredProcedure
C. CommandType.TableDirect
D. Command.Stored

---------------------------------------------------------------------


24. Which namespace is used to access the connection string from the Web.Config file?

A. Web.Configuration
B. Web.Config
C. System.Configuration
D. System.Web.Configuration

---------------------------------------------------------------------


25. SqlConnection object is used for?

A. MySql database
B. Oracle database
C. Microsoft SQL Server database
D. Access database

---------------------------------------------------------------------


26. Which method is suited best when we have aggregate values in the SELECT statement?

A. ExecuteScalar()
B. ExecuteNoQuery().
C. ExecuteReader()
D. None of the above

----------------------------------------------------------------------


27. On which object we set the properties to create a primary key for DataTable?

A. DataSet
B. DataTable
C. DataRelation
D. DataColumn

---------------------------------------------------------------------


28. Which of the following are the events of the DataTable object?

A. RowChanged
B. ColumnChanged
C. RowChanging
D. All Of the above

---------------------------------------------------------------------


29. Which Data Provider gives the maximum performance when connected to SQL Server?

A. SqlClient Data Provider
B. OLEDB Data Provider
C. Oracle Data Provider
D. All of the above


---------------------------------------------------------------------


30. If we want that the command object should return XML data then which Command object will be used?

A. GetXMLData
B. GetXml
C. ExecuteXmlReader
D. None of the above

3 comments:

Thanks

SQL server tricky questions