PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which code segment should you insert at line 06?

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

You write the following code segment in the code-behind file to create a Web form. (Line numbers are included for reference only.)

01 string strQuery = “select * from Products;”
02 + “select * from Categories”;
03 SqlCommand cmd = new SqlCommand(strQuery, cnn);
04 cnn.Open();
05 SqlDataReader rdr = cmd.ExecuteReader();
06
07 rdr.Close();
08 cnn.Close();

You need to ensure that the gvProducts and gvCategories GridView controls display the data that is contained in the following two database tables:

The Products database table
The Categories database table

Which code segment should you insert at line 06?

What should you do?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You write the following code segment to create a client-script function. (Line
numbers are included for reference only.)
01 function updateLabelControl(labelId, newText) {
02 var label = $find(labelId);
03 label.innerHTML = newText;
04 }
The client script function uses ASP.NET AJAX and updates the text of any Label control in
the Web form.When you test the client script function, you discover that the Label controls
are not updated. You receive the following JavaScript error message in the browser: “‘null’ is
null or not an object.” You need to resolve the error.What should you do?

Which code segment should you insert at line 08?

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. The service has an operation contract named GetMessage. You write the following code segment to implement the service. (Line numbers are included for reference only.)

01 public Message GetMessage()
02 {
03 Message msg=null;
04 string action=”GetMessageResponse”;
05 MessageVersion ver=MessageVersion.Default;
06 FileStream stream=new FileStream(@”D:\File.xml”, 07 FileMode.OpenOrCreate);
08
09 return msg;
10 }

You need to send the contents of the File.xml file to a client application by using the SOAP body.
Which code segment should you insert at line 08?

What additional step should you perform?

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

You use Windows Authentication for the application.
You set up NTFS file system permissions for the Sales group to access a particular file.
You discover that all the users are able to access the file.
You need to ensure that only the Sales group users can access the file.

What additional step should you perform?

What should you do?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.The application contains a DataSet object that has a table. The DataSet object is
as shown in the following exhibit.
You need to ensure that the application meets the following requirements without creating another table:
The DataSet can be extended by using the designer.
The application displays all product records.
The product records can be filtered by ProductID.
What should you do?

What should you do?

You create a Windows Communication Foundation (WCF) application by using Microsoft Visual Studio 2008 and the .NET Framework 3.5. You create a WCF service by using the following code segment. (Line numbers are included for reference only.)

01 [ServiceContract]
02 public interface IContosoService
03 {
04 [OperationContract]
06 void ProcessTransaction();
07 }
09 public class ContosoService : IContosoService
10 {
11 public void ProcessTransaction() {
12 try {
13 BusinessComponent.ProcessTransaction();
14 }
15 catch (ApplicationException appEx) {
17 }
18 }
19 }

The BusinessComponent.ProcessTransaction method will only throw exceptions from the ApplicationException type. You plan to debug the WCF service. You need to ensure that the WCF service meets the following requirements:

Detailed exception information is provided to the client application. Subsequent calls can be issued to the service by using the same proxy intance after an exception is caught in the client application. What should you do?

What should you do?

You are creating an application page that will open a dialog box.

The dialog box uses a custom master page. You write the following code segment. (Line numbers are included for reference only.)

01 <script type=”text/javascript”>
02 function DialogCallback(dialogResult, returnValue)
03 {
04 }
05 function OpenEditDialog(id)
06 {
07 var options = {
08 url:”http://intranet/_layouts/MsgToShow.aspx,
09 width: 300,
10 height: 300,
11 dialogReturnValueCallback: DialogCallback
12 };
13 SP.UI.ModalDialog.showModalDialog(options);
14 }
15 </script>

You need to ensure that the code opens the dialog box.

What should you do?

Which code segment should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You write the following code fragment.

<asp:DropDownList AutoPostBack=”true”
ID=”DropDownList1″ runat=”server”
onselectedindexchanged=
“DropDownList1_SelectedIndexChanged”>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:DropDownList>

You also add a MultiView control named MultiView1 to the Web page. MultiView1 has three child View controls.

You need to ensure that you can select the View controls by using the DropDownList1 DropDownList control.

Which code segment should you use?

should you use?

You are creating a Windows Forms application by using the .NET Framework 3.5. The
application requires a thread that accepts a single integer parameter.You write the following
code segment. (Line numbers are included for reference only.)
01 Thread myThread = new Thread(new
ParameterizedThreadStart(DoWork));
02 myThread.Start(100);
03 …
You need to declare the method signature of the DoWork method. Which method signature
should you use?