PrepAway - Latest Free Exam Questions & Answers

Category: 70-568

Exam 70-568: UPGRADE: Transition your MCPD Enterprise Application Developer Skills to MCPD Enterprise Application Developer 3.5, Part 1

What should you do?

You create a Microsoft ASP.NETWeb application by using the Microsoft .NET Framework
version 3.5.The computer that hosts the ASP.NET Web application contains a local instance
of Microsoft SQL Server 2005. The instance uses Windows Authentication. You plan to
configure the membership providers and the role management providers.You need to install
the database elements for both the providers on the local computer. What should you do?

Which line of code should you add to ensure that the value of the count variable is 4?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.You write the following code segment.
DataTable dt = new DataTable(“Strings”);
dt = new DataTable();
dt.Columns.Add(“Strings”);
dt.Rows.Add(“A-B”);
dt.Rows.Add(“C-D”);
var c = from Strings in dt.AsEnumerable()
select Strings[0];
int count = 0;
You need to ensure that the value of the count variable is 4. Which line of code should you add?

Which line of code should you insert at line 08?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.You write the following code segment. (Line numbers are included for reference
only.)
01 DataTable dt = new DataTable();
02 dt.Columns.Add(“number”);
03 dt.Columns.Add(“string”);
04 dt.Rows.Add(1, “3”);
05 dt.Rows.Add(2, “2”);
06 dt.Rows.Add(3, “1”);
07 var result = from p in dt.AsEnumerable()
08
09 foreach (var number in result) {
10 Console.Write(number.ToString());
11 }
You need to display the string “321”.Which line of code should you insert at line 08?

What should you do?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.You write the following code segment. (Line numbers are included for reference
only.)
01 private void GetRecords(SqlDataAdapter da, DataTable table) {
02
03 try {
04 da.Fill(table);
05 }
06 catch (SqlException exp) {
07
08 }
09 finally {
10
11 }
12 }
13
The da.SelectCommand.CommandText property is set to a stored procedure. The stored
procedure declares a variable named @msg.For each record that contains a bad shipping
address, the stored procedure performs the following tasks:
It sets @msg with the id of the record.
It raises an error for the record.
The error raised is as shown in the following text:
RaiseError(@msg, 10, 1)
You need to ensure that all valid records are retrieved even if invalid records are present.
You also need to ensure that a list item is added to the lstResults list box for each invalid
record. 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. The application runs on Microsoft IIS 6.0. You create a page named
oldPage.aspx.You need to ensure that the following requirements are met when a user
attempts to access the page:
The browser displays the URL of the oldPage.aspx page.

The browser displays the page named newPage.aspx.
Which code segment should you use?

Which line of code should you insert in the constructor of the page?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You create a page that contains the following code fragment.
<asp:ListBox ID=”lstLanguages” AutoPostBack=”true” runat=”server” />

You write the following code segment in the code-behind file for the page. void
BindData(object sender, EventArgs e) {
lstLanguages.DataSource = CultureInfo.GetCultures(CultureTypes.AllCultures);
lstLanguages.DataTextField = “EnglishName”; lstLanguages.DataBind();
}
You need to ensure that the lstLanguages ListBox control maintains the selection of the user
during postback.Which line of code should you insert in the constructor of the page?

Which code segment should you insert at line 16?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You create a Web page that has a GridView control named GridView1. The
GridView1 control displays the data from a database named Region and a table named
Location. You write the following code segment to populate the GridView1 control. (Line
numbers are included for reference only.)
01 protected void Page_Load(object sender, EventArgs e)
02 {
03 string connstr;
04
05 SqlDependency.Start(connstr);
06 using (SqlConnection connection =
07 new SqlConnection(connstr))
08 {
09 SqlCommand sqlcmd = new SqlCommand();
10 DateTime expires = DateTime.Now.AddMinutes(30);
11 SqlCacheDependency dependency = new
12 SqlCacheDependency(“Region”, “Location”);
13 Response.Cache.SetExpires(expires);
14 Response.Cache.SetValidUntilExpires(true);
15 Response.AddCacheDependency(dependency);
16
17 sqlcmd.Connection = connection;
18 GridView1.DataSource = sqlcmd.ExecuteReader();
19 GridView1.DataBind();
20 }
21 }
You need to ensure that the proxy servers can cache the content of the GridView1
control.Which code segment should you insert at line 16?

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 Default.aspx in the root of the application. You
add an ImageResources.resx resource file in the App_GlobalResources folder. The
ImageResources.resx file contains a localized resource named LogoImageUrl. You need to
retrieve the value of LogoImageUrl. Which code segment should you use?

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.The application allows users to post comments to a page that can be viewed by
other users.You add a SqlDataSource control named SqlDS1. You write the following code
segment.(Line numbers are included for reference only.)
01 private void SaveComment()
02 {
03 string ipaddr;
04
05 SqlDS1.InsertParameters[“IPAddress”].DefaultValue = ipaddr;
06 …
07 SqlDS1.Insert();
08 }
You need to ensure that the IP Address of each user who posts a comment is captured along
with the user’s comment.Which code segment should you insert 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.The application contains the following code segment. public class
CapabilityEvaluator
{
public static bool ChkScreenSize( System.Web.Mobile.MobileCapabilities cap, String arg)
{
int screenSize = cap.ScreenCharactersWidth *
cap.ScreenCharactersHeight;
return screenSize < int.Parse(arg);
}
}
You add the following device filter element to the Web.config file.
<filter name=”FltrScreenSize” type=”MyWebApp.CapabilityEvaluator,MyWebApp”
method=”ChkScreenSize” />
You need to write a code segment to verify whether the size of the device display is less than
80 characters.Which code segment should you use?


Page 7 of 12« First...56789...Last »