web analytics

High Quality 70-516 Questions and Answers Verified By Experts Ensure Your Exam Pass (1-20)

QUESTION 1
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You manually create your own Context class named AdventureWorksDB that inherits from ObjectContext. You need to use AdventureWorksDB to invoke a stored procedure that is defined in the data source. Which method should you call?

A.    Translate
B.    ExecuteFunction
C.    ExecuteStoreQuery
D.    ExecuteStoreCommand

Answer: B

QUESTION 2
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application uses the ADO.NET Entity Framework to model entities. You create an entity as shown in the following code fragment.
<EntityType Name="ProductCategory">
<Key>
  <PropertyRef Name="ProductCategoryID" />
</Key>
<Property Name="ProductCategoryID" Type="int" Nullable="false" StoreGeneraedPattern="Identity" />
<Property Name="ParentProductCategoryID" Type="int" />
<Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="50" />

</EntityType>
You need to provide two entity-tracking fields:
— Rowguid that is automatically generated when the entity is created
— ModifiedDate that is automatically set whenever the entity is updated.
Which code fragment should you add to the .edmx file?

A.    <Property Name="rowguid" Type="uniqueidentifier" Nullable="false" StoreGeneratedPattern="Computed"/>
<Property Name="ModifiedDate" Type="timestamp" Nullable="false" StoreGeneratedPattern="Computed"/>
B.    <Property Name="rowguid" Type="uniqueidentifier" Nullable="false" StoreGeneratedPattern="Identity"/>
<Property Name="ModifiedDate" Type="timestamp" Nullable="false" StoreGeneratedPattern="Identity"/>
C.    <Property Name="rowguid" Type="uniqueidentifier" Nullable="false" StoreGeneratedPattern="Identity"/>
<Property Name="ModifiedDate" Type="timestamp" Nullable="false" StoreGeneratedPattern="Computed"/>
D.    <Property Name="rowguid" Type="uniqueidentifier" Nullable="false" StoreGeneratedPattern="Computed"/>
<Property Name="ModifiedDate" Type="timestamp" Nullable="false" StoreGeneratedPattern="Identity"/>

Answer: C

QUESTION 3
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication Foundation (WCF) Data Services service. The service connects to a Microsoft SQL Server 2008 database. The service is hosted by an Internet Information Services (IIS) 6.0 server. You need to ensure that applications authenticate against user information stored in the database before the application is allowed to use the service. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Configure IIS to require basic authentication.
B.    Configure IIS to allow anonymous access.
C.    Configure IIS to require Windows authentication.
D.    Enable the WCF Authentication Service.
E.    Modify the Data Services service to use a Microsoft ASP.NET membership provider.

Answer: BE

QUESTION 4
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication Foundation (WCF) Data Services service. You discover that when an application submits a PUT or DELETE request to the Data Services service, it receives an error. You need to ensure that the application can access the service. Which header and request type should you use in the application?

A.    an X-HTTP-Method header as part of a POST request
B.    an X-HTTP-Method header as part of a GET request
C.    an HTTP ContentType header as part of a POST request
D.    an HTTP ContentType header as part of a GET request

Answer: A

QUESTION 5
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. You use the following SQL statement to retrieve an instance of a DataSet object named ds:
SELECT CustomerID, CompanyName, ContactName, Address, City
FROM dbo.Customers
You need to query the DataSet object to retrieve only the rows where the ContactName field is not NULL. Which code segment should you use?

A.    from row in ds.Tables[0].AsEnumerable()
where (string)row["ContactName"] != null
select row;
B.    from row in ds.Tables[0].AsEnumerable()
where row.Field<string>("ContactName") != null
select row;
C.    from row in ds.Tables[0].AsEnumerable()
where !row.IsNull((string)row["ContactName"])
select row;
D.    from row in ds.Tables[0].AsEnumerable()
where !Convert.IsDBNull(row.Field<string>("ContactName"))
select row;

Answer: B

QUESTION 6
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. You use Entity SQL to retrieve data from the database. You need to find out whether a collection is empty. Which entity set operator should you use?

A.    ANYELEMENT
B.    EXCEPT
C.    EXISTS
D.    IN

Answer: C

QUESTION 7
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. You use Entity SQL to retrieve data from the database. You need to enable query plan caching. Which object should you use?

A.    EntityCommand
B.    EntityConnection
C.    EntityTransaction
D.    EntityDataReader

Answer: A

QUESTION 8
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server 2008 database. You need to ensure that the application calls a stored procedure that accepts a table-valued parameter. You create a SqlParameter object. What should you do next?

A.    Set the SqlDbType of SqlParameter to Udt.
B.    Set the SqlDbType of SqlParameter to Variant.
C.    Set the ParameterDirection of SqlParameter to Output.
D.    Set the SqlDbType of SqlParameter to Structured. Set the TypeName of SqlParameter to Udt.

Answer: D

QUESTION 9
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server 2008 database. You need to use a spatial value type as a parameter for your database query. What should you do?

A.    Set the parameter’s SqlDbType to Binary.
B.    Set the parameter’s SqlDbType to Variant.
C.    Set the parameter’s SqlDbType to Udt. Set the parameter’s UdtTypeName to GEOMETRY.
D.    Set the parameter’s SqlDbType to Structured. Set the parameter’s TypeName to GEOMETRY.

Answer: C

QUESTION 10
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application contains the following XML fragment:
<ApplicationMenu>
<MenuItem name="File">
   <MenuItem name="New">
    <MenuItem name="Project" />
    <MenuItem name="Web Site" />
   </MenuItem>
   <MenuItem name="Open">
    <MenuItem name="Project" />
    <MenuItem name="Web Site" />
   </MenuItem>
   <MenuItem name="Save" />
</MenuItem>
<MenuItem name="Edit">
  <MenuItem name="Cut" />
  <MenuItem name="Copy" />
  <MenuItem name="Paste" />
</MenuItem>
<MenuItem name="Help">
  <MenuItem name="Help" />
  <MenuItem name="About" />
</MenuItem>
</ApplicationMenu>
The application queries the XML fragment by using the XmlDocument class. You need to select all the descendant elements of the MenuItem element that has its name attribute as File. Which XPath expression should you use?

A.    //*[@name=’File’][name()=’MenuItem’]
B.    /ApplicationMenu/MenuItem[‘File’]//MenuItem
C.    /ApplicationMenu/MenuItem/descendant::MenuItem[‘File’]
D.    /ApplicationMenu/MenuItem[@name=’File’]/descendant::MenuItem

Answer: D


PassLeader[11]

http://www.passleader.com/70-516.html

QUESTION 11
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication Foundation (WCF) Data Services service. You deploy the service to the following URL: http://contoso.com/Northwind.svc.
You want to query the WCF Data Services service to retrieve a list of customer objects.
You need to ensure that the query meets the following requirements:
— Only customers that match the following filter criteria are retrieved: City="Seattle" AND Level > 200.
— Data is sorted in ascending order by the ContactName and Address properties.
Which URL should you use for the query?

A.    http://contoso.com/Northwind.svc/Customers?City=Seattle & Level gt 200 & $orderby=ContactName,Address
B.    http://contoso.com/Northwind.svc/Customers?City=Seattle & Level gt 200 & $orderby=ContactName and Address
C.    http://contoso.com/Northwind.svc/Customers?$filter=City eq ‘Seattle’ and Level gt 200 & $orderby=ContactName,Address
D.    http://contoso.com/Northwind.svc/Customers?$filter=City eq ‘Seattle’ and Level gt 200 & $orderby=ContactName and Address

Answer: C

QUESTION 12
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 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 need to update the City property of the Customer record that has its ID value as 123.
You also need to preserve the current values of the remaining properties. Which HTTP request should you use?

A.    PUT /Northwind.svc/Customers(123)
Host: contoso.com
Content-Type: application/json { City: ‘Seattle’ }
B.    PUT /Northwind.svc/Customers(123)
Host: contoso.com
Accept: application/json { City: ‘Seattle’ }
C.    MERGE /Northwind.svc/Customers(123)
Host: contoso.com
Content-Type: application/json { City: ‘Seattle’ }
D.    MERGE /Northwind.svc/Customers(123)
Host: contoso.com
Accept: application/json { City: ‘Seattle’ }

Answer: C

QUESTION 13
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server 2008 database. The application uses DataContexts to query the database. You create a function that meets the following requirements:
— Updates the Customer table on the database when a customer is marked as deleted.
— Updates the related entries in other tables (CustomerAddress, CustomerContacts) by marking them as deleted.
— Prevents consumer code from setting the Deleted column’s value directly.
You need to ensure that the function verifies that customers have no outstanding orders before they are marked as deleted. You also need to ensure that existing applications can use the update function without requiring changes in the code. What should you do?

A.    Override the Delete operation of the DataContext object.
B.    Override the Update operation of the DataContext object.
C.    Modify the SELECT SQL statement provided to the DataContext object to use an INNER JOIN between the Customer and Orders tables.
D.    Add new entities to the DataContext object for the Customers and Orders tables.

Answer: A

QUESTION 14
You use Microsoft Visual Studio 2010 and the Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application uses DataContexts to query the database. You define a foreign key between the Customers and Orders tables in the database. You need to ensure that when you delete a customer record, the corresponding order records are deleted. You want to achieve this goal by using the minimum amount of development effort. What should you do?

A.    Override the Delete operation of the customer entity.
B.    Remove the foreign key between the Customers and Orders tables.
C.    Use the ExecuteDynamicDelete method of the DataContext object.
D.    Modify the foreign key between the Customers and Orders tables to enable the ON DELETE CASCADE option.

Answer: D

QUESTION 15
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application uses DataContexts to query the database. The application meets the following requirements:
— Stores customer data offline.
— Allows users to update customer records while they are disconnected from the server.
— Enables offline changes to be submitted back to the SQL Server by using the DataContext object.
You need to ensure that the application can detect all conflicts that occur between the offline customer information submitted to the SQL Server and the server version. You also need to ensure that you can roll back local changes. What should you do?

A.    Add a try/catch statement around calls to the SubmitChanges method of the DataContext object and catch SqlExceptions.
B.    Add a try/catch statement around calls to the SubmitChanges method of the DataContext object and catch ChangeConflictExceptions.
C.    Override the Update operation of the DataContext object. Call the ExecuteDynamicUpdate method to generate the update SQL.
D.    Call the SubmitChanges method of the DataContext object. Pass System.Data.Linq.ConflictMode.ContinueOnConflict to the method.

Answer: D

QUESTION 16
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a multi-tier application. You use Microsoft ADO.NET Entity Data Model (EDM) to model entities. The model contains entities named SalesOrderHeader and SalesOrderDetail. For performance considerations in querying SalesOrderHeader, you detach SalesOrderDetail entities from ObjectContext. You need to ensure that changes made to existing SalesOrderDetail entities updated in other areas of your application are persisted to the database. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Re-attach the SalesOrderDetail entities.
B.    Set the MergeOption of SalesOrderDetail to MergeOptions.OverwriteChanges.
C.    Set the MergeOption of SalesOrderDetail to MergeOptions.NoTracking.
D.    Call ObjectContext.ApplyCurrentValue.
E.    Call ObjectContext.ApplyOriginalValue.

Answer: AE

QUESTION 17
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application uses the ADO.NET Entity Framework to manage customer and related order records. You add a new order for an existing customer. You need to associate the Order entity with the Customer entity. What should you do?

A.    Set the Value property of the EntityReference of the Order entity.
B.    Call the Add method on the EntityCollection of the Order entity.
C.    Use the AddObject method of the ObjectContext to add both Order and Customer entities.
D.    Use the Attach method of the ObjectContext to add both Order and Customer entities.

Answer: A

QUESTION 18
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database over the network. The application uses data from multiple related database tables. You need to ensure that the application can be used if the connection is disconnected or unavailable. Which object type should you use to store data from the database tables?

A.    DataSet
B.    DataAdapter
C.    DataReader
D.    Data Services

Answer: A

QUESTION 19
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use a TableAdapter object to load a DataTable object. The DataTable object is used as the data source for a GridView control to display a table of customer information on a Web page. You need to ensure that the application meets the following requirements:
— Load only new customer records each time the page refreshes.
— Preserve existing customer records.
What should you do?

A.    Set the ClearBeforeFill property of the TableAdapter to false. Use the Fill method of the TableAdapter.
B.    Set the ClearBeforeFill property of the TableAdapter to false. Use the GetData method of the TableAdapter to create a new DataTable.
C.    Set the ClearBeforeFill property of the TableAdapter to true. Use the Fill method of the TableAdapter to load additional customers.
D.    Set the ClearBeforeFill property of the TableAdapter to true. Use the GetData method of the TableAdapter to create a new DataTable.

Answer: A

QUESTION 20
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application stores user names and passwords in the database. You need to ensure that users cannot read passwords extracted from the database. What should you do?

A.    Encrypt stored passwords by using the RC2CryptoServiceProvider class.
B.    Encrypt stored passwords by using the TripleDESCryptoServiceProvider class.
C.    Append a random salt to the password by using the RNGCryptoServiceProvider class. Encrypt stored passwords by using the RijndaelManaged class.
D.    Append a random salt to the password by using the RNGCryptoServiceProvider class. Hash stored passwords by using the SHA1CryptoServiceProvider class.

Answer: D


High Quality 70-516 Questions and Answers Verified By Experts Ensure Your Exam Pass

http://www.passleader.com/70-516.html