Do you want to pass Microsoft 70-516 Exam ? If you answered YES, then look no further. Braindump2go offers you the best 70-516 exam questions which cover all core test topics and certification requirements.All REAL questions and answers from Microsoft Exam Center will help you be a 70-516 certified!

C# Scenario BackgroundYou are updating an existing Microsoft .NET Framework 4 application that includes a data layer built with ADO.NET Entity Framework 4. The application communicates with a Microsoft SQL Server 2008 instance named INST01 on a server named SQL01. The application stores data in a database named Contoso in the INST01 instance.You need to update the existing technology and develop new functionality by using Microsoft Visual Studio 2010.Application and Data StructureThe application tracks bicycle parts as they pass through a factory. Parts are represented by the abstract Part entity and its associated partial classes. Each part has a name stored in the Name field and a unique identifier stored in the Id field.Parts are either components (represented by the Component class) such as chains, wheels, and frames, or finished products (represented by the Product class) such as completed bicycles. The Component class and the Product class derive from the Part class and may contain additional class-specific properties.Parts may have a color (represented by the Color class), but not all parts have a color. Parts may be composed of other parts, and those parts may in turn be composed of other parts; any part represents a tree of the parts that are used to build it. The lowest level of the tree consists of components that do not contain other components.A product is a part that has been completed and is ready to leave the factory. A product typically consists of many components (forming a tree of child parts) but can also be constructed by combining other products and/or components to form a bundled product, such as a bicycle and a helmet that are sold together.Components and products are stored in a database table named Parts by using a table-per-hierarchy (TPH) mapping. Components have a null ProductType field and a non-null PartType field. Products have a non-null ProductType field and a null PartType field.The following diagram illustrates the complete Entity data model diagram (EDMX diagram).

The following graphic illustrates details of the Part-Color Association.

The following code segments show relevant portions of the files referenced by the case study items. (Line numbers in the samples below are included for reference only and include a two-character prefix that denotes the specific file to which they belong.)Extension Method.cs

A. Insert the following code segment at line 07.rowcountParameter.Direction = ParameterDirection.ReturnValue Insert the following code segment at line 11.identityParameter.Direction = ParameterDirection.ReturnValueB. Insert the following code segment at line 07.rowcountParameter.Direction = ParameterDirection.Output Insert the following code segment at line 11.identityParameter.Direction = ParameterDirection.OutputC. Insert the following code segment at line 07.rowcountParameter.Direction = ParameterDirection.ReturnValue Insert the following code segment at line 11.identityParameter.Direction = ParameterDirection.OutputD. Insert the following code segment at line 07.rowcountParameter.Direction = ParameterDirection.Output Insert the following code segment at line 11.identityParameter.Direction = ParameterDirection.ReturnValue

Answer: CExplanation:Input-The parameter is an input parameter.InputOutput-The parameter is capable of both input and output.Output-The parameter is an output parameter.ReturnValue-The parameter represents a return value from an operation such as a stored procedure, builtin function, or user-defined function.ParameterDirection Enumeration(http://msdn.microsoft.com/en-us/library/system.data.parameterdirection(v=vs.71).aspx)

QUESTION 222You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application.You create a Database Access Layer (DAL) that is database-independent.The DAL includes the following code segment. (Line numbers are included for reference only.)01 Shared Sub ExecuteDbCommand(connection As DbConnection)02 If connection <> Nothing Then03 Using connection04 Try05 connection.Open()06 Dim command As DbCommand = connection.CreateCommand()07 command.CommandText = “INSERT INTO Categories (CategoryName) VALUES (‘Low Carb’)”08 command.ExecuteNonQuery()10 Catch ex As Exception11 Trace.WriteLine(“Exception.Message: ” + ex.Message)12 End Try13 End Using14 End If15 End SubYou need to log information about any error that occurs during data access. You also need to log the data provider that accesses the database.Which code segment should you insert at line 09?

Answer: CExplanation:Exception.InnerException Gets the Exception instance that caused the current exception. Message Gets a message that describes the current exception. Exception.Source Gets or sets the name of the application or the object that causes the error.OleDbException catches the exception that is thrown only when the underlying provider returns a warning or error for an OLE DB data source. DbException catches the common exception while accessing data base.

QUESTION 223You 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 database table named ProductCatalog as shown in the exhibit. (Click the Exhibit button.)You add the following code segment to query the first row of the ProductCatalog table. (Line numbers are included for reference only.)01 Using cnx As var = New SqlConnection(connString)02 Dim command As var = cnx.CreateCommand()03 command.CommandType = CommandType.Text04 command.CommandText = “SELECT TOP 1 * FROM dbo.ProductCatalog”05 cnx.Open()06 Dim reader As var = command.ExecuteReader()07 If reader.Read() Then08 Dim id As var = reader.GetInt32(0)10 reader.Close()11 End If12 End UsingYou need to read the values for the Weight, Price, and Status columns.Which code segment should you insert at line 09?

QUESTION 224Drag and Drop QuestionYou have a method named updateCustomers that updates a DataTable.You need to develop a method that meets the following requirements:Takes a DataTable as a parameterCalls updateCustomers by using the DataTableReturns false if updateCustomers updates one of the rows in the DataTable with a value that contains @) in the FirstName column.What code should you use? (To answer, drag the appropriate elements to the correct locations. Each element may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

Answer:

QUESTION 225You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL Server 2008 database. You add the following table to the database.CREATE TABLE ObjectCache (Id INT IDENTITY PRIMARY KEY,SerializedObjectData XML )You write the following code segment to retrieve records from the ObjectCache table. (Line numbers are included for reference only.)01Dim s As String = GetConnectStringFromConfigFile(“xmldb”)02Using conn As New SqlConnection(s)03Using cmd As New SqlCommand(04″select * from ObjectCache”, conn))06conn.Open()07Dim rdr As SqlDataReader = cmd.ExecuteReader()08While rdr.Read()10DeserializeObject(obj)11End While12End Using13End UsingYou need to retrieve the data from the SerializedObjectData column and pass it to a method named DeserializeObject.Which line of code should you insert at line 9?

QUESTION 226Drag and Drop QuestionYou use Microsoft .NET Framework 4 to create a data access layer component.The component accesses data from a Microsoft SQL Server database named DB1. The component contains a class named Classl that represents data from a table in DB1 named Tablel. The following is the definition of Classl:

A database developer creates the following stored procedure to add entries to Table1:

You need to edit the Entity Data Model (EDM) for EDMCIassl to use the uspInsertTablel stored procedure to add data to the database.What should you do? (Develop the solution by selecting and ordering the required code snippets. You may not need all of the code snippets.)

Answer:

QUESTION 227Ensure that SSDL can be modified without rebuilding application.

QUESTION 228You use Microsoft .NET Framework 4 to develop an application. You write the following code to update data in a Microsoft SQL Server 2008 database. (Line numbers are included for reference only,)01 Private Sub ExecuteUpdate(ByVal cmd As SqlCommand, ByVal connString As String, ByVal updateStrat As String)03 End SubYou need to ensure that the update statement executes and that the application avoids connection leaks.Which code segment should you insert at line 02?

QUESTION 229You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Communication Foundation (WCF) Data Services service.You deploy the data service to the following URL: http://contoso.com/Northwind.svc.You add the following code segment. (Line numbers are included for reference only.)01 Dim uri As var = New Uri(“http://contoso.com/Northwind.svc/”)02 Dim ctx As var = New NorthwindEntities(uri)03 Dim categories As var = From c In ctx.Categories _04 Select c05 For Each c ategory As var In categories06 PrintCategory(category)08 For Each product As var In category.Products10 PrintProduct(product)11 Next12 NextYou need to ensure that the Product data for each Category object is lazy-loaded.What should you do?

A. Add the following code segment at line 07.ctx.LoadProperty(category, “Products”)B. Add the following code segment at line 09.ctx.LoadProperty(product, “*”)C. Add the following code segment at line 07.Dim strPrdUri As var = String.Format(“Categories({0})?$expand=Products”, category.CategoryID)Dim productUri As var = New Uri(strPrdUri, UriKind.Relative) ctx.Execute(Of Pr oduct)(productUri)D. Add the following code segment at line 09.Dim strPrdUri As var = String.Format(“Products?$filter=CategoryID eq {0}”, category.CategoryID)Dim productUri As var = New Uri(strPrdUri, UriKind.Relative) ctx.Execute(Of Product)(productUri)

Answer: AExplanation:LoadProperty(Object, String) Explicitly loads an object related to the supplied object by the specified navigation property and using the default merge option.UriKind Enumeration(http://msdn.microsoft.com/en-us/library/system.urikind.aspx)RelativeOrAbsolute The kind of the Uri is indeterminate.Absolute The Uri is an absolute Uri.Relative The Uri is a relative Uri.

QUESTION 230The application UI displays a list of products in alphabetical order. To display each product, the UI requires the va of the product Id field and the product Name field.You need to write a LINO query that returns the product name and unique identifier without retrieving any other database columns. The query must create an anonymous type with a field named ProductName that contains the product name and a field named Id that contains the unique identifier.Which query expression should you write?