What should you do?
You are implementing an ASP.NET page.
You add asp:Button controls for Help and for Detail.
You add an ASP.NET skin file named default.skin to a theme.
You need to create and use a separate style for the Help button, and you must use the default style for the Detail button.
What should you do?
Which code segment should you insert at line 10?
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 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 (var cnx = new SqlConnection(connString))
02 {
03 var command = cnx.CreateCommand();
04 command.CommandType = CommandType.Text;
05 command.CommandText =”SELECT TOP 1 * FROM dbo.ProductCatalog”;
06 cnx.Open();
07 var reader = command.ExecuteReader();
08 if (reader.Read()) {
09 var id = reader.GetInt32(0);
10
11 reader.Close();
12 }
13 }
You need to read the values for the Weight, Price, and Status columns.
Which code segment should you insert at line 10?
Exhibit:
Which code segment should you use?
You are creating a Windows Communication Foundation (WCF) service. You do not want to expose the internal implementation at the service layer. You need to expose the following class as a service named Arithmetic with an operation named Sum.
Public Class Calculator
Public Function Add(ByVal x As Integer, ByVal y As Integer) As Integer
End Function
End Class
Which code segment should you use?
Which code segment should you use?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework.
The application has an entity model that includes SalesTerritory and SalesPerson entities as shown in the following diagram.
You need to calculate the total bonus for all sales people in each sales territory. Which code segment should you use?
What should you do?
You are implementing an ASP.NET application that includes a page named TestPage.aspx.
TestPage.aspx uses a master page named TestMaster.master.
You add the following code to the TestPage.aspx code-behind file to read a TestMaster.master public property named CityName.
protected void Page_Load(object sender, EventArgs e)
{
string s = Master.CityName;
}
You need to ensure that TestPage.aspx can access the CityName property.
What should you do?
What should you do?
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)>
03 Public Class OrderService
04
05 <OperationContract()>
06 Public Sub SubmitOrder(ByVal anOrder As Order)
07
08 Try
09 …
10 Catch 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?
Which code segment should you insert at the line 04?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
You are creating the data layer of the application. You write the following code segment.
(Line numbers are included for reference only.)
01 public static SqlDataReader GetDataReader(string sql)
02 {
03 SqlDataReader dr = null;
04 …
05 return dr;
06 }
You need to ensure that the following requirements are met:
* The SqlDataReader returned by the GetDataReader method can be used to retreive rows from the database.
* SQL connections opened within the GetDataReader method will close when the SqlDataReader is closed.
Which code segment should you insert at the line 04?
What should you do?
You are implementing an ASP.NET application that uses data-bound GridView controls in multiple pages.
You add JavaScript code to periodically update specific types of data items in these GridView controls.
You need to ensure that the JavaScript code can locate the HTML elements created for each row in these GridView controls, without needing to be changed if the controls are moved from one page to another.
What should you do?
Which code segment should you insert in line 03?
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 the ADO.NET Entity Framework to model entities.
The database includes objects based on the exhibit (click the Exhibit button).
The application includes the following code segment. (Line numbers are included for reference only.)
01 using(AdventureWorksEntities context = new AdventureWorksEntities())
02 {
03 …
04 foreach (SalesOrderHeader order in customer.SalesOrderHeader)
05 {
06 Console.WriteLine(String.Format(“Order: {0} “, order.SalesOrderNumber));
07 foreach (SalesOrderDetail item in order.SalesOrderDetail)
08 {
09 Console.WriteLine(String.Format(“Quantity: {0} “, item.Quantity));
10 Console.WriteLine(String.Format(“Product: {0} “, item.Product.Name));
11 }
12 }
13 }
You want to list all the orders for a specific customer. You need to ensure that the list contains following fields:
* Order number
* Quantity of products
* Product name
Which code segment should you insert in line 03?
Which connection string should you add to the .config file?
You use Microsoft .NET framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database named AdventureWorksLT.
The database resides on an instance named INSTA on a server named SQL01.
You need to configure the application to connect to the database. Which connection string should you add to the .config file?