Monday 21 September 2015

ADO.Net Objective type Questions and Answers

11. You need to programmatically add a user control without using the Register directive in your code
A. Use AddUserControl
B. Use cannot programmatically add a user control
C. Use UserControl.Add
D. Use LoadControl
Ans: D

12. You need to develop a business component myComp.dll in .Net and use it in your ASP.NET page
a. You require to register the component using regsvr32.exe
b. You require to register the component using TlbExp.exe
c. You require to copy the component to the /bin directory in your applications root directory
d. You require to copy the component to the /bin directory in your applications root directory and register the component using regsvr32.exe
Ans: C

13. Is it possible for multiple aspx pages to use the same code-behind file, if required
A. Yes
B. No
Ans: A

14. How is a ASP.NET presentation page associated with its code-behind
A. The presentation page includes the code-behind file using #include
B. The presentation page includes the code-behind file using <@ Page include="codebehind file name">
C. The presentation page inherits from the code-behind
D. The ASP.NET presentation page and the code-behind page have the same name and hence are automatically associated with each other
Ans: C

15. Which namespace would you use if you need to create an ASP.NET application with Microsoft SQL Server 2000 as the database. 
A. System.Data.SQLServer
B. System.Data.SQLClient
C. System.Data.OleDb
D. System.Data.Microsoft
Ans: B

16. Which namespace would you use if you need to create an ASP.NET application with Oracle as the database. 
A. System.Data.SQLServer
B. System.Data.SQLClient
C. System.Data.OleDb
D. System.Data.NonMS
Ans: C

17. Which statement among the following is correct while opening a connection using theSQLConnection class
A. You cannot specify a connection string
B. You need to specify a Provider parameter for the connection string
C. You need to use a System DSN
D. You cannot use a DSN
Ans: C

18. What method of the Command object would you use if you need to retrieve a single value (for example an aggregate value) from a database
A. ExecuteScalar()
B. ExecuteReader()
C. ExecuteSingle()
D. ExecuteNonQuery()
Ans: A

19. Which are the two things you need to take care of in your ASP.Net application to take advantage of connection pooling (select two)
A. You need to set the Pooling property of the Connection object to True
B. You need to use the same exact connection string whenever you open a database connection
C. You need to call the ReleaseToPool() method after the connection is closed
D. You need to explicitly close the connection with the Close() method
Ans: B,D

20. You have created a ASP.Net page Transaction by using <% Transaction = "Required" %>
A. If a transaction already exists, the page will execute within the context of the transaction. However it will not create a new transaction
B. If a transaction already exists, the page will execute within the context of the transaction. If a transaction does not exist, it will create a new one
C. Creates a new transaction for each request
D. You cannot created a ASP.Net page Transaction by using <% Transaction = "Required" %>
Ans: B

More Questions & Answers:-
Page1 Page2 Page3 Page4 Page5 Page6 Page7

No comments:

Post a Comment