Web Developer Framework 4.0 Sample Questions – 25

Question: You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database. The application has two DataTable objects that reference the Customers and Orders tables in the database. The application contains the following code segment. (Line numbers are included for reference only.) 01 DataSet customerOrders = new DataSet(); 02 customerOrders.EnforceConstraints = true; 03 ForeignKeyConstraint ordersFK = new ForeignKeyConstraint(“ordersFK”, 04 customerOrders.Tables[“Customers”].Columns[“CustomerID”], 05 customerOrders.Tables[“Orders”].Columns[“CustomerID”]); 06 07 customerOrders.Tables[“Orders”].Constraints.Add(ordersFK); You need to ensure that an exception is thrown when you attempt to delete Customer records that have related Order records. Which … Click here to continue…..

Web Developer Framework 4.0 Sample Questions – 24

Question: You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008 database. You create classes by using LINQ to SQL based on the records shown in the You need to create a LINQ query to retrieve a list of objects that contains the OrderID and CustomerID properties. You need to retrieve the total price amount of each Order record. What are two possible ways to achieve this goal (Each correct answer presents a complete solution. Choose two.)

Correct Answer: 1 & 4 … Click here to continue…..

Web Developer Framework 4.0 Sample Questions – 23

Question: You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008 database. The database includes a table named dbo.Documents that contains a column with large binary data. You are creating the Data Access Layer (DAL). You add the following code segment to query the dbo.Documents table. (Line numbers are included for reference only.) 01 public void LoadDocuments(DbConnection cnx) 02 { 03 var cmd = cnx.CreateCommand(); 04 cmd.CommandText = “SELECT * FROM dbo.Documents”; 05 06 cnx.Open(); 07 08 ReadDocument(reader); 09 } You need to ensure that data … Click here to continue…..

Web Developer Framework 4.0 Sample Questions – 22

Question: A Windows Communication Foundation (WCF) application uses a data contract that has several data members. You need the application to throw a SerializationException if any of the data members are not present when a serialized instance of the data contract is deserialized.What should you do Add the KnownType attribute to the data contract. Set a default value in each of the data member declarations. Add the KnownType attribute to the data contract. Set the Order property of each data member to unique integer value. Set the EmitDefaultValue property of each data member to false. Set the IsRequired property of … Click here to continue…..

Web Developer Framework 4.0 Sample Questions – 21

Question: You are creating a Windows Communication Foundation (WCF) service that is implemented as follows. (Line numbers are included for reference only.) 01<ServiceContract()> 02<ServiceBehavior(IncludeExceptionDetailInFaults:=True)> 03Public Class OrderService 04 05<OperationContract()> 06Public Sub SubmitOrder(ByVal anOrder As Order) 07 08Try 09 10Catch ex As DivideByZeroException 11 12 End Try 13 End Sub 14 15 End Class You need to ensure that the stack trace details of the exception are not included in the error information sent to the client. What should you do Replace line 11 with the following line. Throw Replace line 11 with the following line. Throw New FaultException(Of Order)(anOrder, ex.ToString()) … Click here to continue…..