Wednesday, July 30, 2014

ADO.NET Practice Test

ADO.NET Quiz | Practice Test | Online Quiz | ADO.NET Interview preparation | ADO.NET Test | ADO.NET Question Answers
1. Which of the following is the method provided by the DataSet object to generate XML
   A. ReadXML
   B. WriteXML
   C. GetXML
   D. All of above

2. Which of the following is the object of .NET data provider?
   A. Connection
   B. Command
   C. Data Reader
   D. All of above

3. Which of the following is not true for ADO.NET DataSet?
   A. DataSet provides a disconnected view of a data source.
   B. Dataset enables to store data from multiple tables and multiple sources
   C. We can create relationship between the tables in a DataSet.
   D. Content from multiple data sets can easily be combined into a single dataset that contains the net result of all changes
   E. None of the above

4. Which of the following is not the method of DataAdapter?
   A. Fill
   B. FillSchema
   C. ReadData
   D.Update

5. Which one of the below method of the COMMAND object is best suited using aggregate functions in SELECT statements?
   A. ExecuteScalar
   B. ExecuteReader
   C.ExecuteNonQuery

6. Which of the below is not true about ADO.NET?
   A. ADO.NET enables to create distributed data sharing applications
   B. ADO.NET uses XML to transfer data across applications and data source
   C. ADO.NET doesn't support disconnected architecture
   D. The classes of ADO.NET are defined in the System.Data namespace

7. Which of the following event exposed by the DataTable object?
   A. RowChanged
   B. ColumnChanged
   C. RowChanging
   D. All of above

8. To perform asynchronous data access, what must be added to connection string?
   A. BeginExecute=true
   B. MultiThreaded=true
   C. MultipleActiveResultSets=true
   D. Asynchronous=true

9. You are working on a DataSet and want to be able to display data, sorted different ways. How do you do so?
   A. Use the Sort method on the DataTable object.
   B. Use the DataSet object’s Sort method.
   C. Use a DataView object for each sort.
   D. Create a DataTable for each sort, using the DataTable object’s Copy method, and then Sort the result.

10. What method is used to Get a value indicating whether the column contains non-existent or missing values?
    A. GetType()
    B. IsDBNull ()
    C. GetValues ()
    D. All the above

11. To improve the performance and scalability of your .NET application, which one of the following techniques would help?
    A. Connection Strings
    B. Connection Pooling
    C. SQL Injection
    D. Data Adapter

12. Which method is used to commit all changes in the DataSet or DataTable?
    A. Update()
    B. AcceptChanges()
    C. GetChanges()
    D. None

13. By default, the connection pooling property with connection string is set as True/False
    A. True
    B. False

14. Between Windows authentication and SQL Server Authentication, SQL Server authentication is the trusted one.
    A. False
    B. True

15. Which of the following is a method of DataView?
    A. Add
    B. Remove
    C. Find
    D. All the above

16. Base class for LINQ to SQL is:
    A. DataContext
    B. DataSet
    C. Data.SqlClient
    D. None

17. Which of the following operations can you cannot perform on an ADO.NET DataSet?
    A. A DataSet can be synchronised with the database.
    B. A DataSet can be synchronised with a RecordSet.
    C. A DataSet can be converted to XML.
    D. You can infer the schema from a DataSet.

18. How can you get the ColumnName,DataType ColumnSize, IsKeyColumn,IsAutoIncrement of the table from the dataset?
    A. GetSchemaTable method of the DataReader
    B. Fill method of data adaptor
    C. GetTableDetails method
    D. Dataset.GetDataTable()

19. Which method do you invoke on the Data Adapter control to load your generated dataset?
    A. Fill( )
    B. Read( )
    C. ExecuteQuery( )
    D. None of these

20. ColumnMapping belongs to System.Data namespaces ?
    A. true
    B. false

21. The Dataset is an core of connected architecture.
    A. true
    B. false

22. Which of the following is not a member of ADODBCommand object?
    A. ExecuteReader
    B. ExecuteScalar
    C. ExecuteStream
    D. Open
    E. CommandText

23. What is the advantage of Disconnected mode of ADO.Net in ASP.Net?
    A. Automatically dump data at client PC
    B. Not necessary to connect with server
    C. user data can update and retrieve in dataset in disconnected mode and when connection connected, update values with server
    D. All of the above

24. The object used by SQL connection to make Security Demands
    A. SQLLCientAttribute
    B. SQLPermission
    C. SQLPermissionClient
    D. SQLClientPermission

25. You are transferring records from one database to another. You need to decide whether you can use the SqlBulkCopy class to transfer the records. What should you do?
    A. Ensure that the source database is Microsoft SQL Server.
    B. Ensure that the destination database is Microsoft SQL Server.
    C. Ensure that the column names in the source table match the column names in the destination
    D. table.
    E. Ensure that the bulk copy program (bcp) utility is installed on the destination server.

26. Which of the following is not true about ADO.NET?
    A. ADO.NET enables to create distributed data sharing applications
    B. ADO.NET uses XML to transfer data across applications and data source
    C. ADO.NET doesn't support disconnected architecture
    D.The classes of ADO.NET are defined in the System.Data namespace

27. Which of the following illustrates the benefit of ADO.NET?
    A. Interoperability
    B. It uses DataSet to represent data in memory that can store data from multiple tables and multiple sources.
    C. Disconnected data access
    D.All of above

28. Which of the following is the object of .NET data provider?
    A. Connection
    B. Command
    C. Data Reader
    D. All of above

29. DataAdapter object populates a DataSet and resolves updates with the data source. Yes or No?
    A. Yes    B. No

30. When you create a relationship between tables in ADO.NET DataSet
    A. a UniqueConstraint is added to the parent table
    B. a ForeignKeyConstraint is added to the child table by default
    C. Both 1 and 2
    D. NONE

31. Which of the following method of the command object is best suited when you have aggregate functions in a SELECT statement?  
    A. ExecuteReader
    B. ExecuteNonQuery
    C. ExecuteScalar
    D. NONE

32. Which of the following is the event that is exposed by the DataTable object?
    A. RowChanged
    B. ColumnChanged
    C. RowChanging
    D. All of above

33. What is the default connection pool size in ADO.NET?
   a) 5                     b) 20
   c) 100                 d) 200

34. You want to execute a DELETE Sql query on a table in a database. You want to retrieve the number of rows that were deleted. What code should you use?
    A.SqlCommand cmd = new SqlCommand(); cmd.CommandText = "DELETE FROM MyTable"; int rowcount = cmd.ExecuteScalar();
    B.SqlCommand cmd = new SqlCommand(); cmd.CommandText = "DELETE FROM MyTable"; int rowcount = cmd.ExecuteNonQuery();
    C.SqlCommand cmd = new SqlCommand(); cmd.CommandText = "DELETE FROM MyTable"; SqlDataReader dr = cmd.ExecuteReader(); int rowcount = dr.RowCount;
    D.SqlCommand cmd = new SqlCommand(); cmd.CommandText = "DELETE FROM MyTable"; int rowcount = cmd.ExecuteQuery();

35. You have code that executes SQL statements on a database within the context of a SQLTransaction. You want to ensure that no user can perform any updates in the database until your transaction is complete. What IsolationLevel should you use?
    A.ReadCommitted
    B.ReadUncommitted
    C.Serializable
    D.Chaos

36. Which function of the SqlCommand object must you use in order to execute an INSERT Sql Query?
    A.ExecuteScalar();
    B.ExecuteNonQuery();
    C.ExecuteReader();
    D.ExecuteCommand();

37. You create a SqlCommand object com in order to execute a SQL Query on a database table.
    Which code snippet should you use in order to select all records from the table Customers?
    A.com.CommandText = "SELECT * FROM Customers"; com.CommandType = CommandType.StoredProcedure;
    B.com.CommandText = "SELECT * FROM Customers"; com.CommandType = CommandType.TableDirect;
    C.com.CommandText = "SELECT * FROM Customers"; com.CommandType = CommandType.Text;
    D.com.CommandText = Customers;com.CommandType = CommandType.Text;

38. You use a TransactionScope in your application in your application in order to use transaction semantics.
    What code should you use in order to commit the transaction within the transaction scope?
    A. TransactionScope.Completed = true;
    B. TransactionScope.IsCompleted = true;
    C. TransactionScope.Complete();
    D. TransactionScope.Commit();

39. You decide to use named parameters in a SqlCommand object in order to execute SQL queries on a database.
    You have a parameter named “CustomerName”. How do you refer to it within the SQL query text in the SqlCommand object?
    A. “?CustomerName”
    B. “@CustomerName
    C. “%CustomerName”
    D. “#CustomerName”

40. Which of the following illustrates the benefit of ADO.NET?
    A.Interoperability
    B.It uses DataSet to represent data in memory that can store data from multiple tables and multiple sources.
    C.Disconnected data access
    D.All of above

Answers: 1.D  2.D  3.E  4.C  5.A  6.C  7.D  8.D  9.C  10.B  11.B  12.B 
  13.A  14.A  15.C  16.A  17.B  18.A  19.A  20.A  21.B  22.D  23.C  24.D
  25.B  26.C  27.D  28.D  29.A  30.C  31.C  32.D  33.C  34.B  35.C  36.B
  37.C  38.C  39.B  40.D

7 comments:


  1. This blog gives very important info about .Net Thanks for sharing


    Dot Net Online Course Bangalore

    ReplyDelete

  2. It seems you are so busy in last month. The detail you shared about your work and it is really impressive that's why i am waiting for your post because i get the new ideas over here and you really write so well.

    Selenium training in Chennai
    Selenium training in Bangalore
    Selenium training in Pune
    Selenium Online training

    ReplyDelete
  3. I always enjoy reading quality articles by an individual who is obviously knowledgeable on their chosen subject. Ill be watching this post with much interest. Keep up the great work, I will be back
    python interview questions and answers
    python tutorials
    python course institute in electronic city

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Thanks for one marvelous posting! I enjoyed reading it; you are a great author. I will make sure to bookmark your blog and may come back someday. I want to encourage that you continue your great posts.
    Salesforce Training | Online Course | Certification in chennai | Salesforce Training | Online Course | Certification in bangalore | Salesforce Training | Online Course | Certification in hyderabad | Salesforce Training | Online Course | Certification in pune

    ReplyDelete