T TestsWorld

Free practice test · Microsoft

Exam 70-305

15 questions with a timer and instant results. Practise in short drills or take the full test, then see exactly which topics need work.

📝 15 questions ⏱ 20 min for all 🎯 Pass mark 70% 💸 Free, unlimited attempts
⚡
Short drills

Pick 10, 25 or 50 questions for a quick round, or take all of them.

💡
Learn as you go

Practice mode shows the right answer and an explanation for every question.

📊
See your weak spots

Your result shows strong and weak topics and what to read next.

What's in the test

Easy 13% Medium 53% Hard 33%
ForeignKeyConstraint Delete Rules 1DataRelation Objects 1DataView Sorting 1StringBuilder Concatenation 1Connection Pooling 1Data Provider Selection 1SqlCommand Execution Methods 1Connection Strings 1ADO.NET Transactions 1SQL Joins 1Client-Side Event Handling 1Stored Procedure Output Parameters 1

Sample questions with answers

5 of the 15 questions in Exam 70-305. Try each one, then open the answer.

  1. Question 1
    You ASP.NET application manages order entry data by using a DataSet object named TKorderEntry. The TKorderEntry object includes two DataTable objects named orderNames and OrderDetails. A ForeignKeyConstraint object named orderDetailsKey is defined between the two DataTable objects. You attempt to delete a row in orderNames while there are related rows in OrderDetails, and an exception is generated. What is the most likely cause of the problem?
    • A. The current value of OrderDetails.KeyDeleteRule is Rule.Cascade.
    • B. The current value of OrderDetails.KeyDeleteRule is Rule.SetNull.
    • C. The current value of OrderDetails.KeyDeleteRule is Rule.SetDefault.
    • D. The current value of OrderDetails.KeyDeleteRule is Rule.None..
    Show answer
    Answer: D. The current value of OrderDetails.KeyDeleteRule is Rule.None..
    Explanation: The rule enumeration indicates the action that occurs when a ForeignKeyConstraint is enforced. None specifies that no action will occur, but exceptions are generated. This is what has occurred in this scenario. Reference: .NET Framework Class Library, Rule Enumeration [Visual Basic] Incorrect Answers A: Cascade specifies that all rows containing that value are also deleted. B: SetNull specifies that values in all child columns are set to null values. C: SetDefault specifies that all child columns be set to the default value for the column.
  2. Question 2
    You are creating an ASP.NET application to track sales orders for Techno Inc Ltd. The application users an ADO.NET DataSet object that contains two DataTable objects. One table is named Orders, and the other table is named OrderDetails. The application displays data from the Orders table in a list box. You want the order details for an order to be displayed in a grid when a user selects the order in the list box. You want to modify these objects to enable your code to find all the order details for the selected order. What should you do?
    • A. Add a DataRelation object to the Relations collection of the DataSet object.
    • B. Use the DataSet.Merge method to connect the Orders table and the OrderDetails table to each other.
    • C. Add a ForeignKeyConstraint to the OrderDetails table.
    • D. Add a keyref constraint to the OrderDetails table.
    Show answer
    Answer: A. Add a DataRelation object to the Relations collection of the DataSet object.
    Explanation: In order to enable the DataGrid to display from multiple tables we need to relate the tables with DataRelation. Reference: Visual Basic and Visual C# Concepts, Introduction to the Windows Forms DataGrid Control Incorrect Answers B: We don’t want to merge the two datasets into a single dataset. C: A foreignKeyConstraint represents an action restriction enforced on a set of columns in a primary key/foreign key relationship when a value or row is either deleted or updated. However, a foreign key constraint does not create a relation between the tables. D: We need to define a relation not a constraint.
  3. Question 3
    You create an ASP.NET application to display a sorted list of products in a DataGrid control. The product data is stored in a Microsoft SQL Server database named Techno Inc Products. Each product is identified by a numerical value named ProductID, and each product has an alphabetic description named ProductName. You write ADO.NET code that uses a SqlDataAdapter object and a SqlCommand object to retrieve the product data from the database by calling a stored procedure. You set the CommandType property of the SqlCommand object to CommandType.StoredProcedure. You set the CommandText property of the object to procProductList. Your code successfully fills a DataTable object with a list of products that is sorted by ProductID in descending order. You want to data to be displayed in reverse alphabetic order by ProductName. What should you do?
    • A. Change the CommandType property setting of the SqlCommand object to CommandType.Text. Change the CommandText property setting of the SqlCommand object to the following: SELECT * FROM procProductList ORDER BY ProductName DESC; Bind the DataGrid control to the DataTable object.
    • B. Create a new DataView object based on the DataTable object. Set the Sort Property of the DataView object to “ProductName DESC”. Bind the DataGrid control to the DataView object.
    • C. Set the AllowSorting property of the DataGrid control to True. Set the SortExpression property of the DataGridColumn that displays ProductName to “ProductName DESC”. Bind the DataGrid control to the DataTable object.
    • D. Set the DisplayExpression property of the DataTable object to “ORDER BY ProductName DESC”. Bind the DataGrid control to the DataTable object.
    Show answer
    Answer: B. Create a new DataView object based on the DataTable object. Set the Sort Property of the DataView object to “ProductName DESC”. Bind the DataGrid control to the DataView object.
    Explanation: We can create a DataView object, set the appropriate Sort Property and bind the DataGrid control to the DataView, and not the DataTable object. Reference: .NET Framework Developer's Guide, Sorting and Filtering Data Using a DataView [Visual Basic] Incorrect Answers A: procProductList is a stored procedure. It cannot be used in the FROM clause of a SELECT statement. C: The DataGrid.AllowSorting property gets or sets a value that indicates whether sorting is enabled. The DataGridColumn.SortExpression property gets or sets the name of the field or expression to pass to the OnSortCommand method when a column is selected for sorting. However, the sorting only occurs when a user clicks the column header. D: The DataTable.DisplayExpression gets or sets the expression that will return a value used to represent this table in the user interface. This is only a display string. We cannot use it to sort the DataTable..
  4. Question 4
    You are creating an ASP.NET page for Techno Inc. The page uses string concatenation to gather data from multiple e-mail messages and format the data for display on the page. You want to ensure that the page displays as quickly as possible. What should you do?
    • A. Write code that uses the Append method of the StringBuilder object.
    • B. Write code that uses the Substring method of the String object.
    • C. Write code that uses the Concat method of the String object.
    • D. Write code that uses the plus-sign (+) operator to concatenate the strings.
    Show answer
    Answer: A. Write code that uses the Append method of the StringBuilder object.
    Explanation: The StringBuilder.Append method appends the string representation of a specified object to the end of this instance.The StringBuilder class represents a string-like object whose value is a mutable sequence of characters. The value is said to be mutable because it can be modified once it has been created by appending, removing, replacing, or inserting characters. Reference: .NET Framework Class Library, StringBuilder.Append Method [Visual Basic] Incorrect Answers B: The Substring method is used to select a part of a string, not to concatenate multiple strings. C: The String.Concat method Concatenates one or more instances of String, or the String representations of the values of one or more instances of Object. However, compared to the Append method of the StringBuilder object, the Concat method create new instances, and is therefore not the preferred method. D: Not he best solution.
  5. Question 5
    You are creating an ASP.NET application that uses the Microsoft SQL Server .NET Data Provider to connect to Techno Inc’s database. Your database administrator reports that, due to heavy usage of the application, data requests are being blocked while users wait for new connections to be created. You want to improve throughput by setting a minimum connection pool size of 10. What should you do?
    • A. Add a connection element under an appSettings element in the Web.config file for your application, and specify a minimum size of 10 for the connection pool.
    • B. Add a connection element under an appSettings element in the Machine.config file on your Web server, and specify a minimum size of 10 for the connection pool.
    • C. Add a Min Pool Size property to the connection string you use when opening a connection, and specify a minimum size of 10 for the connection pool.
    • D. Add a Min Pool Size property to your ADO.NET connection objects, and assign a value of 10 to the property.
    Show answer
    Answer: C. Add a Min Pool Size property to the connection string you use when opening a connection, and specify a minimum size of 10 for the connection pool.
    Reference: .NET Framework Developer's Guide, Connection Pooling for the SQL Server .NET Data Provider Incorrect Answers A, B: The appSettings element contains custom application settings. However, Minimum pool size should be configured in the connection string, not in the custom application settings. D: Min Pool Size is not a property of a connection object. It is an attribute in the connection string.

Want all 15 with a timer and a topic-wise result? Start the free test at the top of this page.

About this practice test

This course will give you the ability to develop and implement Web-based applications with Web forms, ASP.NET, and the Microsoft .NET Framework. When you pass the Developing and Implementing Web Applications with Microsoft Visual Basic® .NET and Microsoft Visual Studio® .NET exam, you achieve Microsoft Certified Professional status.

This practice test belongs to TestsWorld's Microsoft certification track. The bank covers the long history of Microsoft technical exams — from the classic 70-xxx Windows Server, SQL Server, Exchange and SharePoint papers, through to MCITP / MCSE designations. Many of these exams are now retired but the underlying concepts remain useful for legacy environment support, brown-field migrations, and historical reference.

What this practice test gives you

18 multiple-choice questions covering the subject area, served from a randomised order so each attempt feels fresh. Take the test at your own pace. Allowed time per attempt: 20 min. Pass mark: 70%.

Study tips. Many Microsoft exams in this bank are legacy 70-xxx era; review the explanations carefully and cross-check terminology against the modern Microsoft Learn documentation where the concept still applies. For currently-live exams, Microsoft Learn's role-based learning paths remain the canonical free study material.

Before you start: device, fullscreen and proctoring