PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which code segment should you add at line 06?

You are creating a Windows Forms application by using the .NET Framework 3.5. You write
the following code segment to bind a list of categories to a drop-down list.(Line numbers are
included for reference only.)
01 OleDbConnection cnnNorthwind = new OleDbConnection(connectionString);
02 OleDbCommand cmdCategory = new OleDbCommand( “SELECT CategoryID,
CategoryName FROM Categories ORDER BY CategoryName”, cnnNorthwind);
03 OleDbDataAdapter daCategory = new OleDbDataAdapter(cmdCategory);
04 DataSet dsCategory = new DataSet();
05 daCategory.Fill(dsCategory);
06
You need to ensure that the drop-down list meets the following requirements:
Displays all category names.
Uses the category ID as the selected item value.
Which code segment should you add at line 06?

Which code fragment should you add?

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You write the following code segment.

namespace MyServices
{
[ServiceContract()]
interface IManageOrders
{

}
}
The service metadata must be exposed at the relative address named meta.

You need to add an endpoint element to the app.config file of the service host. Which code fragment should you add?

What should you do?

You work as the Microsoft.NET developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. All servers in the domain run Windows Server 2003. The development and deployment of Extensible Markup Language (XML) Web Services forms part of your responsibilities at Domain.com.
After receiving instructions, you have just finished developing and deploying public and private Extensible Markup Language (XML) Web services to a production server. This production server has been configured with Microsoft Internet Information Services (IIS) 6.0. The Web services are located on different IIS virtual directories. Each of these IIS virtual directories hosts either public Web services or private Web services, but not both. Part of the instructions that you received also states that Web service clients must have the ability to discover the public Web services dynamically, but not the private Web services. The Web Service clients should also be granted the ability to ability to dynamically discover any new public Web services that are added to an existing virtual directory. To this end you now need to configure the server to meet these requirements. You should take care that your configuration does not prevent the discovery of Web services in new virtual directories unless you reconfigure the server.

What should you do? (Each correct answer presents part of the solution. Choose three.)

Which code segment should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.

You create a Web page named enterName.aspx.
The Web page contains a TextBox control named txtName.
The Web page cross posts to a page named displayName.aspx that contains a Label control named lblName.
You need to ensure that the lblName Label control displays the text that was entered in the txtName TextBox control.

Which code segment should you use?

Which three actions should you perform next?

You are creating a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5. You need to host the WCF service on the IIS Web server. First, you create a new folder for your application files. Next, you use the IIS management tool to create a Web application in the new folder. Which three actions should you perform next? (Each correct answer presents part of the solution. Choose three.)

What should you do?

You work as the Microsoft.NET developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. All servers in the domain run Windows Server 2003. The development and deployment of Extensible Markup Language (XML) Web Services forms part of your responsibilities at Domain.com.
After receiving instructions you have just completed the development and the deployment of an Extensible Markup Language (XML) Web service application. This XML Web service application contains ten (10) Web services. At present dynamic discovery on the Web server that hosts the application has been disabled. To this end you now need to configure the Web.config file of the application to allow Web service clients the ability to dynamically discover all the Web services. You also want to ensure that the Web service clients will be able to discover any future Web services that will be added.

What should you do? (Choose the correct configuration.)

Which code segment should you insert at line 04?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a custom Web user control named SharedControl. The control will be compiled as a library.

You write the following code segment for the SharedControl control. (Line numbers are included for reference only.)

01 protected override void OnInit(EventArgs e)
02 {
03 base.OnInit(e);
04
05 }

All the master pages in the ASP.NET application contain the following directive.

<%@ Master Language=”C#” EnableViewState=”false” %>

You need to ensure that the state of the SharedControl control can persist on the pages that reference a master page.

Which code segment should you insert at line 04?

What should you do?

You are creating a Windows Forms application by using the .NET Framework 3.5. You
create a new form in your application. You add a PrintDocument control named pntDoc to
the form.To support the print functionality, you write the following code segment in the
application. (Line numbers are included for reference only.)
01 pntDoc.BeginPrint += new PrintEventHandler(PrintDoc_BeginPrint);
02 …
03 bool canPrint = CheckPrintAccessControl();
04 if (!canPrint) {
05
06 }
07
You need to ensure that the following requirements are met:
When the user has no print access, font and file stream initializations are not
executed and the print operation is cancelled.
Print operations are logged whether or not the user has print access.
What should you do?