Which code segment should you insert at line 07?
You 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 Orders(
ID numeric(18, 0) NOT NULL,
OrderNaroe varchac (50) NULL,
OrderTime time (7) NULL,
OrderDate dace NULL)
You write the following code to retrieve data from the OrderTime column. (Line numbers are
included for reference only.)
01 Dim conn As SqlConnection = New SqlConnection(“”*”)
02 conn.Open()
03 Dim cmd As SqlCommand = New SqlCommand(
“SELECT ID, OrderTime FROM Orders”, conn)
04 Dim rdr As SqlDacaReader = crod.ExecuteReader()
05
06 While rdr.Read()
07
08 End While
You need to retrieve the OrderTime data from the database. Which code segment should you insert
at line 07?
You need to create a Plain Old CLR Object (POCO) class that can be used with the ObjectContext.CreateObject me
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application.
You use the ADO.NET Entity Framework Designer to model entities. You need to create a Plain Old
CLR Object (POCO) class that can be used with the ObjectContext.CreateObject method to create a
proxy. What should you do?
Which code segment should you insert at line 05?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application connects to a Microsoft SQL Server database. You create a DataSet object in the
application. You add two DataTable objects named App_Products and App_Categories to the
DataSet.
You add the following code segment to populate the DataSet object. (Line numbers are included for
reference only.)
01 Public Sub Filifcnx As SqlConnection, ds As DataSet)
02 Dim crod As var = cnx.CreateCorttnand()
03 cmd.CommandText = “SELECT * FROM dbo.Products;” + “SELECT * FROM dbo.Categories”
04 Dim adapter As var = New SqlDataAdapter(cmd) 05
06 End Sub
You need to ensure that App_Products and App_Categories are populated from the dbo.Products
and dbo.Categories database tables. Which code segment should you insert at line 05?
Which URL should you use for the query?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 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?
You need to ensure that the application calls a stored procedure that accepts a table-valued parameter
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 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?
What should your model contain?
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 Data Definition Language (DDL) script
of the database contains the following code segment.
CREATE TABLE [Sales].[SalesOrderHeader](
[SalesOrderID] [int] IDENTITY(1,1) NOT NULL,
[BillToAddressID] [int] NOT NULL,
…
CONSTRAINT [PK_SalesOrderHeader_SalesOrderID]
PRIMARY KEY CLUSTERED ([SalesOrderID] ASC)
)
ALTER TABLE [Sales].[SalesOrderHeader]
WITH CHECK ADD CONSTRAINT [FK_SalesOrderHeader_Address]
FOREIGN KEY([BilIToAddressID])
REFERENCES [Person].[Address]([AddressID])
You create an ADO.NET Entity Framework model.
You need to ensure that the entities of the model correctly map to the DDL of the database.
What should your model contain?
You need to ensure that entities can be sent to the service as XML
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You
use Plain Old CLR objects (POCO) to model your entities. The application communicates with a
Windows Communication Foundation (WCF) Data Services service. You need to ensure that entities
can be sent to the service as XML. What should you do?
which two procedures should you add the Qproductld parameter?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You
create stored procedures by using the following signatures:
• CREATE procedure [dbo].[Product_Insert] (@name varchar (50) / 6pri.ce float)
• CREATE procedure [dbo].[Product_Updatej (@id int, Bname varchar(50), @price float)
• CREATE procedure [dbo].[Product_Delete] (@ id int)
• CREATE procedure [dbo] .[Order_Insert] (@productld int, @quantity int)
• CREATE procedure [dbo] .[Order_Update] (@id int, Gquantity int,@originalTimestamp
tlmestamp)
• CREATE procedure [dbo].[Order_Delete](@id int)
You create a Microsoft ADO.NET Entity Data Model (EDM) by using the Product and Order entities as
shown in the exhibit. (Click the Exhibit button.)
You need to map the Product and Order entities to the stored procedures. To which two procedures
should you add the Qproductld parameter? (Each correct answer presents part of the solution.
Choose two.)
Which code segment should you insert at line 08?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application
that uses LINQ to SQL. The application contains the following model.
You write the following code. (Line numbers are included for reference only.)
01 Shared Sub Insert()
02
03 Dim dc As NorthuindDataContext –
New NorthwindDataContext (“…”)
04 Dim neuCustomer As Customer = New Customer()
05 newCustomer.Firstname = “Todd”
06 newCustomer.Lastname = “Meadows”
07 newCustomer.Email = “tmeadous@contoso.com”
08
09 dc.SubmitChanges()
10 End Sub
A product named Bike Tire exists in the Products table. The new customer orders the Bike Tire
product. You need to ensure that the correct product is added to the order and that the order is
associated with the new customer. Which code segment should you insert at line 08?
Which code segment should you use?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application
that uses the Entity Framework. The application has the entity model shown in the following
diagram.
The application must create a projection of the unique set of names and year-to-date sales for
territories where at least one sales person had sales last year of more than $100,000. The projection
must consist of properties named Sales and Name. You need to write a query that will generate the
required projection. Which code segment should you use?