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

Which line of code should you add to display only the digits from the RegionCode field?

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(“Customer”);
dt.Columns.Add(“ID”, typeof(Int32));
dt.Columns.Add(“State”, typeof(String));
dt.Columns.Add(“RegionCode”, typeof(String));
dt.Rows.Add(1, “WA”, “MT297EM”);
dt.Rows.Add(2, “CA”, “MT33SG”);
dt.Rows.Add(3, “NY”, “MT73229MP”);
var query = from c in dt.AsEnumerable() select c[“RegionCode”];
foreach (string rNum in query)
You need to display only the digits from the RegionCode field. Which line of code should you add?

What you should do?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You write the following code fragment.
<asp:RadioButton ID=”RadioButton1″ runat=”server”
oncheckedchanged=”RadioButton_CheckedChanged”/>
<asp:RadioButton ID=”RadioButton2″ runat=”server”
oncheckedchanged=”RadioButton_CheckedChanged”/>
<asp:RadioButton ID=”RadioButton3″ runat=”server”
oncheckedchanged=”RadioButton_CheckedChanged”/>
You need to ensure that the following requirements are met:
Users can select only one RadioButton control at a time.
The Web page is not reloaded when a RadioButton control is selected.
What you should do?

segment should you use?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.The application uses the following LINQ query.
var query = from o in orderLinesQuery
where (string)o[“CarrierTrackingNumber”] == “AEB6-4356-80”
select new
{
SalesOrderID = o.Field<int>(“SalesOrderID”),
OrderDate = o.Field<DateTime>(“OrderDate”)
};
The CarrierTrackingNumber field in the DataRow is nullable.You need to ensure that an
exception does not occur if the CarrierTrackingNumber field has a null value.Which code
segment should you use?

<?xml version="1.0" encoding="utf-8" ?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You add an XmlDataSource control named XmlDataSource1 to the Web page.
XmlDataSource1 is bound to an XML document with the following structure.
<?xml version=”1.0″ encoding=”utf-8″ ?>
<clients>
<client ID=”1″ Name=”John Evans” />
<client ID=”2″ Name=”Mike Miller”/>

</clients>
You also write the following code segment in the code-behind file of the Web page.
protected void BulletedList1_Click(object sender, BulletedListEventArgs e) {
//…
}
You need to add a BulletedList control named BulletedList1 to the Web page that is bound
to XmlDataSource1.Which code fragment should you use?

Which code segment should you insert at line 07?

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 List<string> GetEmployers() {
02 List<string> employers = new List<string>();
03 SqlCommand cmd = new SqlCommand();
04 …
05 XmlReader reader = cmd.ExecuteXmlReader();
06 while (reader.Read()) {
07
08 }
09 return employers;
10 }
The cmd object returns the following XML data structure.
<Resume>
<Name>
<Name.First>Shai</Name.First>
<Name.Last>Bassli</Name.Last>
</Name>
<Employment>
<Emp.OrgName>Wingtip Toys</Emp.OrgName>

</Employment>

</Resume>
You need to populate the employers list with each employer entry in the XML data
structure.
Which code segment should you insert at line 07?

Which code segment should you insert at line 02?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.The application reads the following contacts.xml file.
<contacts>
<contact contactId=”2″>
<firstName>Don</firstName>
<lastName>Hall</lastName>
</contact>
<contact contactId=”3″>
<firstName>Simon</firstName>
<lastName>Rapier</lastName>
</contact>
<contact contactId=”4″>
<firstName>Shu</firstName>
<lastName>Ito</lastName>
</contact>
</contacts>
You write the following code segment. (Line numbers are included for reference only.)
01 XDocument loaded = XDocument.Load(@”C:\contacts.xml”);
02
03 foreach (string name in q)
04 Console.WriteLine(“{0}”, name);
You need to ensure that the application outputs only the names Simon Rapier and
ShuIto.Which code segment should you insert at line 02?

override method should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You derive a new validation control from the BaseValidator class.The validation
logic for the control is implemented in the Validate method in the following manner.
protected static bool Validate(string value) {

}
You need to override the method that validates the value of the related control. Which
override method should you use?

What should you do?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET. The application connects to a Microsoft SQL Server 2005 database.The
connection string of the application is defined in the following manner.
“Server=Prod; Database=WingtipToys;Integrated Security=SSPI;Asynchronous
Processing=true”
The application contains the following code segment. (Line numbers are included for
reference only.)
01 protected void UpdateData(SqlCommand cmd) {
02 cmd.Connection.Open();
03
04 lblResult.Text = “Updating …”;
05 }
The cmd object takes a long time to execute.You need to ensure that the application
continues to execute while cmd is executing. What should you do?

should you insert at line 02?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.The application contains a SqlDataAdapter object named daOrder. The
SelectCommand property of the daOrder object is set. You write the following code
segment. (Line numbers are included for reference only.)
01 private void ModifyDataAdapter() {
02
03 }
You need to ensure that the daOrder object can also handle updates. Which code segment
should you insert at line 02?

Which code segment should you add at line 03?

You are creating a Windows application for a financial services provider by using the .NET
Framework 3.5.You write the following code segment in the form. (Line numbers are
included for reference only.)
01 string queryString =
02 “SELECT CategoryID, CategoryName FROM Categories”;
03
The connection string for the financial services database is stored in the variable named
connString.You need to ensure that the form populates a DataGridView control named
gridCAT. Which code segment should you add at line 03?


Page 10 of 12« First...89101112