MCQOPTIONS
Saved Bookmarks
This section includes 13 Mcqs, each offering curated multiple-choice questions to sharpen your ASPDotNET (MCQ) questions and answers knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
The three statements are given below about DataSet and DataReader, choose the correct option according to the statement.Statement 1: DataSet Provides Disconnected environment but DataReader provides Connected environment. Statement 2: DataSet Provides Connected environment but DataReader provides Disconnected environment. Statement 3: DataSet Can store multiple table simultaneously but DataReader Supports a single table based on a single SQL query. |
| A. | Only Statement 1 is correct. |
| B. | Statement 1 and 2 is correct. |
| C. | Statement 2 and 3 is correct. |
| D. | Statement 1 and 3 is correct. |
| Answer» E. | |
| 2. |
What determines the connection pool that a connection should use? 1. A connection string2. The identity or credentials of the user opening the connection3. The database being connected to4. The connection object used to connect to the database |
| A. | 1, 2 |
| B. | 1, 2, 3 |
| C. | 1, 3 |
| D. | 1, 4 |
| Answer» B. 1, 2, 3 | |
| 3. |
OleDbConnectionobject works with?1. When connecting to an Oracle database2. When connecting to an Office Access database3. When connecting to SQL Server 6.x or later4. When connecting to SQL Server 2000 |
| A. | 1, 2 |
| B. | 2, 3 |
| C. | 1, 3 |
| D. | 4 |
| Answer» C. 1, 3 | |
| 4. |
What is the minimal information needed by a connection string to open a connection to a SQL Server 2000 or SQL Server 2005 database? 1. A valid data source2. A valid provider name3. A valid file path4. Appropriate credentials or Integrated Security settings |
| A. | 1, 2 |
| B. | 1, 2, 3 |
| C. | 1, 3 |
| D. | 1, 4 |
| Answer» E. | |
| 5. |
What are the recommended techniques for enabling connection pooling on for a SQL Server 2000 or SQL Server 2005 database? 1. Setting the OLE DB Services connection string keyword to -42. Opening a connection and not explicitly disabling pooling3. Setting the connection string keyword Pooling = True in the connection string4. Using the Connection Pooling tab of the ODBC Data Source Administrator dialogBox |
| A. | 1, 2 |
| B. | 1, 2, 3 |
| C. | 2, 3 |
| D. | 1, 4 |
| Answer» D. 1, 4 | |
| 6. |
What are the minimum attribute is required to create a connection string using SqlConnection object? |
| A. | - Data Source |
| B. | - Server |
| C. | Option A and B both are correct |
| D. | None of the above |
| Answer» D. None of the above | |
| 7. |
What happens when you call the Close method of a connection object? 1. The connection is destroyed.2. The connection is returned to the connection pool.3. The StateChangeevent is fired.4. All non - committed pending transactions are rolled back. |
| A. | 1, 2 |
| B. | 1,3 |
| C. | 2, 3, 4 |
| D. | All of the above |
| Answer» D. All of the above | |
| 8. |
How will you create the SQL Server Connection Objects in Code? Choose the correct option. |
| A. | SqlConnection con = new SqlConnection ("Data Source=ServerName; Initial Catalog=DatabaseName;Integrated Security=True"); |
| B. | SqlConnection con = new SqlConnection(); |
| C. | using (SqlConnection con = new SqlConnection("Data Source=ServerName; Initial Catalog=DatabaseName;Integrated Security=True")) |
| D. | All of the above codes are correct. |
| Answer» E. | |
| 9. |
When would you typically use an Input parameter? 1. When the parameter value is created based on user input2. When the parameter is used to send data from the application to the database3. When the command is set to execute a statement with a WHERE clause4. When the parameter value is passed to an INSERT statement |
| A. | 1, 2 |
| B. | 1, 2, 3 |
| C. | 2, 3 |
| D. | 1, 4 |
| Answer» D. 1, 4 | |
| 10. |
What should you do to access the returned tabular data after starting execution of a command that runs asynchronously? (Choose all that apply.)1. Call the EndExecuteNonQuerymethod.2. Call the EndExecuteReadermethod.3. Wait for the StatementCompletedevent to fire and iterate through the DataReader.4. Wait for the StatementCompletedevent to fire, call the EndExecuteReadermethod, and then iterate through the DataReader. |
| A. | 1, 2 |
| B. | 1, 2, 3 |
| C. | 2, 3 |
| D. | 2, 4 |
| Answer» E. | |
| 11. |
What are the Command object property settings to execute a stored procedure?1. CommandType = Text, CommandText = stored procedure name2. CommandType= Text, CommandText = SQL syntax to execute the storedprocedure3. CommandType = StoredProcedure, CommandText = SQL syntax to execute thestored procedure4. CommandType = StoredProcedure, CommandText = stored procedure name |
| A. | 1, 2 |
| B. | 1, 2, 3 |
| C. | 2, 4 |
| D. | 1, 4 |
| Answer» D. 1, 4 | |
| 12. |
What is the connection string s key / value pair for using WindowsAuthentication in SQLServer 2000 and SQL Server 2005? |
| A. | 1, 2 |
| B. | 1, 2, 3 |
| C. | 2, 3 |
| D. | 1, 4 |
| Answer» D. 1, 4 | |
| 13. |
What property contains the actual error message returned by SQL Server? 1. SqlException.Source2. SqlException.Message3. SqlError.Class4. SqlError.Message |
| A. | 1, 2 |
| B. | 1, 2, 3 |
| C. | 1, 3 |
| D. | 2, 4 |
| Answer» E. | |