Which code segment should you use?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5. The application consumes a Microsoft Windows Communication Foundation
(WCF) service.The WCF service exposes the following method.
[WebInvoke]
string UpdateCustomerDetails(string custID);
The application hosts the WCF service by using the following code segment.
WebServiceHost host = new WebServiceHost(typeof(CService), new Uri(“http://win/”));
ServiceEndpoint ep = host.AddServiceEndpoint(typeof(ICService), new WebHttpBinding(),
“”);
You need to invoke the UpdateCustomerDetails method. Which code segment should you use?
Which technology should you use?
You create an application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5. You have a pre-defined database schema. You plan to design a business object layer in the application. The business object layer must map each database table in the schema to an object in the layer. The application must provide support for different database providers. You need to identify a technology to implement the business object layer by using the minimum amount of development effort. Which technology should you use?
Which code segment should you add at line 04?
You need to disable the CriticalExceptionCount measure for all user solutions.
You write the following code segment. (Line numbers are included for reference only.)
01 SPUserCodeService userCode = SPUserCodeService.Local;
02 SPResourceMeasureCollection measures = userCode.ResourceMeasures;
03 SPResourceMeasure measure = measures[“CriticalExceptionCount”];
04
05 measure.Update();
Which code segment should you add at line 04?
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:ListBox SelectionMode=”Multiple” ID=”ListBox1″ runat=”server”></asp:ListBox>
<asp:ListBox ID=”ListBox2″ runat=”server”></asp:ListBox>
<asp:Button ID=”Button1″ runat=”server” Text=”Button” onclick=”Button1_Click” />
You need to ensure that when you click the Button1 control, a selected list of items move from the ListBox1 control to the ListBox2 control.
Which code segment should you use?
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 authentication mechanism should you use?
You create an ASP.NET application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5. The application will be deployed to a Microsoft Windows Server 2008 server. Intranet users will access the application by using Windows Vista client computers. The Web server, client computers, and Windows user accounts are located in the same Active Directory.
You need to identify an appropriate authentication mechanism that meets the following requirements:
Supports security impersonation and delegation.
Avoids passing user credentials as clear text.
Which authentication mechanism should you use?
What should you do?
You have a SharePoint site collection. The root Web of the site collection has the URL http://intranet.
You plan to create a user solution that will contain a Web Part. The Web Part will display the title of the root Web.
You write the following code segment for the Web Part. (Line numbers are included for reference only.)
01 SPSite currentSite = new SPSite(“http://intranet”);
02
03 Label currentTitle = new Label();
04 currentTitle.Text = currentSite.RootWeb.Title;
You add the Web Part to a page in the root Web and receive the following error message: “Web Part Error: Unhandled exception was thrown by the sandboxed code wrapper’s Execute method in the partial trust app domain: An unexpected error has occurred.”
You need to prevent the error from occurring.
What should you do?
What should you do?
You are maintaining an ASP.NET application by using the .NET Framework 3.5.
The application uses Forms authentication.
Security testing of the application reveals that users can access the sessions of other users on different computers.
You need to configure the application to eliminate the vulnerability.
What should you do?
Which option should you choose?
StreamWriter xsw = new StreamWriter(“Customers.xml”);
xsw.Close();
You need to write the data to the custDS DataSet along with the schema.
Which option should you choose?
Which binding object should you use?
You create an application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5. The application exposes a Windows Communication Foundation (WCF) service that will be consumed by an ASP.NET application. The WCF application and the ASP.NET application will be
deployed on the same server. You need to ensure that the WCF service meets the following requirements:
The communication between the applications incurs minimum latency.
The binding satisfies the ordered delivery constraint that is specified in the service implementation by using the DeliveryRequirements attribute.
Which binding object should you use?