What should you do?
You use Microsoft .NET Framework 4.0 to develop an application that uses LINQ to SQL. The LINQ to SQL model contains the Product entity.
A stored procedure named GetActiveProducts performs a query that returns the set of active products from the database.
You need to invoke the stored procedure to return the active products, and you must ensure that the LINQ to SQL context can track changes to these entities. What should you do?
Which code segment should you use in the Initialize method?
You are developing a WCF data service that will expose an existing Entity Data Model (EDM).
You have the following requirements:
* Users must be able to read all entities that are exposed in the EDM.
* Users must be able to update or replace the SalesOrderHeader entities.
* Users must be prevented from inserting or deleting the SalesOrderHeader entities
You need to ensure that the data service meets the requirements. Which code segment should you use in the Initialize method?
What should you do?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to several SQL Server databases. You create a function that modifies customer records that are stored in multiple databases.
All updates for a given record are performed in a single transaction. You need to ensure that all transactions can be recovered. What should you do?
Which control GUID file should you use?
You are developing an ADO.NET 4.0 application that interacts with a Microsoft SQL Server 2008 server through the SQL Server Native Client.
You create a trace DLL registry entry and you register all of the trace schemas.
You need to trace the application data access layer. Which control GUID file should you use?
What should you do in the ADO.NET Entity Framework Designer?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application.
You use the ADO.NET Entity Framework Designer to model entities.
You need to ensure that the entities are self-tracking. What should you do in the ADO.NET Entity Framework Designer?
Which storage Model section of the .edmx file should you include?
You use Microsoft Visual Studio 2010 to create a Microsoft .NET Framework 4.0 application.
You create an Entity Data Model for the database tables shown in the following diagram.
You need to modify the .edmx file so that a many-to-many association can exist between the Address and Customer entities.
Which storage Model section of the .edmx file should you include?
Which code segment should you insert at line 04?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework.
Entity types in the model are generated by the Entity Data Model generator tool (EdmGen.exe).
You write the following code. (Line numbers are included for reference only.)
01 MemoryStream stream = new MemoryStream();
02 var query = context.Contacts.Include(SalesOrderHeaders.SalesOrderDetails);
03 var contact = query.Where(it.LastName = @lastname, new ObjectParameter(lastname, lastName)).First();
04 ….
You need to serialize the contact and all of its related objects to the MemoryStream so that the contact can be deserialized back into the model.
Which code segment should you insert at line 04?
What are two possible TransactionScope constructors that you can use for the inner transaction to achieve this
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database.
The application uses nested transaction scopes. An inner transaction scope contains code that inserts records into the database.
You need to ensure that the inner transaction can successfully commit even if the outer transaction rolls back.
What are two possible TransactionScope constructors that you can use for the inner transaction to achieve this goal?
(Each correct answer presents a complete solution. Choose two.)
where p.ProductCategory.Name = @p0?
You use Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework.
The application defines the following Entity SQL (ESQL) query, which must be executed against the mode.
string prodQuery = select value p from Products as p where p.ProductCategory.Name = @p0?;
You need to execute the query. Which code segment should you use?
Which code segment should you use?
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database.
You add the following stored procedure to the database.
CREATE PROCEDURE dbo.GetClassAndStudents
AS
BEGIN
SELECT * FROM dbo.Class
SELECT * FROM dbo.Student
END
You create a SqIConnection named conn that connects to the database.
You need to fill a DataSet from the result that is returned by the stored procedure.
The first result set must be added to a DataTable named Class, and the second result set must be added to a DataTable named Student.
Which code segment should you use?