You are on page 1of 5

MSc.IT Semester 2 Chapter 4 ADO.NET Multiple Choice Questions 1) ___________ is disconnected, in-memory representation of data.

a. a) DataReader b) DataSet c) DataAdapter d) DataCommand 2) ______________ is readonly, forward-only Recordset. a) DataReader b) DataSet c) DataAdapter d) DataCommand 3) ______________ is a bridge in between DataSet and Database. a) DataReader b) DataSet c) DataAdapter d) DataCommand 4) ______________ method is used to populate DataSet. a) Populate b) Fill c) Open d) Store

P202 - .Net

5) ______________ method returns result set by way of DataReader object. a) ExecuteDataReader b) ExecuteScalar c) ExecuteNonQuery d) ExecuteReader 6) ______________ method returns a single value from a database query. a) ExecuteDataReader b) ExecuteScalar c) ExecuteNonQuery d) ExecuteReader 7) For insert, update, and delete SQL commands, _______________ method is used. a) ExecuteDataReader b) ExecuteScalar c) ExecuteNonQuery d) ExecuteReader 8) To check whether connection is open or not, ___________ property is used. a) ConnectionStatus b) State c) ConnectionState d) Status 9) To Release the connection object, _____________ method is used. a) Release b) Close c) Destroy d) Dispose 10) To use DataSet, __________________ namespace needs to be included. a) System.Data.SqlClient b) System.Sql c) System.Oledb d) System.Data 11) It is not required to open the connection if I am using data adapter. True/False.

12) ______________ section is used to store the connection string in web.config file. 13) To access the connection string from the web.config file, ________________ namespace needs to be included. a) System.Web b) System.Web.Configuration c) System.Configuration

MSc.IT Semester 2

P202 - .Net

14) To access the connection string from the web.config file, ________________ class is used. a) Config b) WebConfig c) SystemConfig d) ConfigurationManager 15) __________________ object provide connection to the database. a) Command b) Connection c) DataReader d) DataAdapter 16) __________________ object is used to execute a command in database. a) Command b) Connection c) DataReader d) DataAdapter 17) To use DataView, __________________ namespace needs to be included. a) System.Data.SqlClient b) System.Sql c) System.Oledb d) System.Data 18) In a connection string, _________________ represents name of the database. a) DataSource b) Initial Database c) Initial Catalog d) Catalog Database 19) In ADO.Net command object, we can have more than one ReturnValue parameter. True/False. 20) In ADO.Net command object, we can have more than one InputOutput parameter. True/False. 21) To execute a stored procedure, __________________ property of command object needs to be set. a) CommandDirection b) CommandSource c) CommandText d) CommandType 22) To include an output parameter, __________________ property of parameter object needs to be set. a) CommandDirection b) Direction c) CommandText d) CommandType 23) __________________ object of ado.net has the best performance, for retrieving the data. a) DataSet b) Connection c) DataReader d) DataAdapter 24) No of records in memory at any given point of time when the DataReader reads the Data. a) One Record b) All Records c) Depends upon DataProvider 25) Which of the following method of the command object is best suited when you have aggregate functions in a SELECT statement? a) ExecuteReader b) ExecuteScalar c) ExecuteNonQuery

MSc.IT Semester 2

P202 - .Net

26. A set of tables are maintained in a Dataset as o TablesCollection object o DataTableCollection object o DataRowsCollection object o TableRowCollection object 27. The namespaces needed to use data mechanisms in ASP.NET pages are o System.Data, System.Data.OleDb or System.Data.SQL o System.Data, System.Data.ODBC o System.Data, System.Data.DataRow o System.Data.DataRowCollection, System.Data.DbType 28. Which one of the following objects is used to create a foreign key between two DataTables? o DataRelation o DataRelationship o DataConstraint o DataKey 29. The method that need to be invoked on the DataAdapter control to load the generated dataset with data is o Bind() o Fill() o FillData() o SetData() o 30. Which of the following operations can you NOT perform on an ADO.NET DataSet? o A DataSet can be synchronised with the database. o A DataSet can be synchronised with a RecordSet. o A DataSet can be converted to XML. o You can infer the schema from a DataSet Ans : A DataSet can be synchronised with a RecordSet. 31. Which of the following is not true for ADO.NET DataSet? o DataSet provides a disconnected view of a data source. o Dataset enables to store data from multiple tables and multiple sources. o We can create relationship between the tables in a DataSet. o All of the above 32. Which of the following method of the command object is best suited when you have aggregate functions in a SELECT statement? o ExecuteScalar o ExecuteReader o ExecuteNonQuery

MSc.IT Semester 2

P202 - .Net

33. Which of the following is the event that is exposed by the DataTable object? o RowChanged o ColumnChanged o RowChanging o All of the above o 34. Which of the following is not the method of DataAdapter? o Fill o FillSchema o ReadData o Update o 35. Which of the following is the method provided by the DataSet object to generate XML? o ReadXML o WriteXML o GetXML o All of the Above o 36. Which of the following is not true about ADO.NET? o ADO.NET enables to create distributed data sharing applications o ADO.NET uses XML to transfer data across applications and data source o ADO.NET doesn't support disconnected architecture o The classes of ADO.NET are defined in the System.Data namespace 37. Which of the following illustrates the benefit of ADO.NET? o Interoperability o It uses DataSet to represent data in memory that can store data from multiple tables and multiple sources. o Disconnected data access o All of the Above 38. Which of the following is the object of .NET data provider? o Connection o Command o DataReader o All of Above 39. DataAdapter object populates a DataSet and resolves updates with the data source. Yes or No? o Yes o No 40. ________________object of ADO.Net is responsible for connecting with data source and Database.
Ans : Connection

MSc.IT Semester 2
41. DataView is part of _______________________ Namespace. 42. DataTable is Part of _______________________Namespace. 43. DataSet is Part of ______________________Namespace.

P202 - .Net

44. All ADO.Net data Providers namespace are subset of _________________ Namespace. 45. Which one of the following ADO.Net object name is not depend on any data providers? a) DataSet b) DataTable c) DataView d) All of Above

You might also like