Exam Name: UPGRADE: Transition your MCPD Enterprise Application Developer Skills to
MCPD Enterprise Application Developer 3.5, Part 1
Exam Type: Microsoft
Exam Code: 70-568(CSharp) Total Questions: 120
Question: 1
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework
version 3.5. The application uses ASP.NET AJAX, and you plan to deploy it in a Web farm
environment. You need to configure SessionState for the application. Which code fragment
should you use?
A. <sessionState mode="InProc" cookieless="UseCookies" />
B. <sessionState mode="InProc" cookieless="UseDeviceProfile" />
C. <sessionState mode="SQLServer" cookieless="false" sqlConnectionString="Integrated
Security=SSPI;data source=MySqlServer;" />
om
D. <sessionState mode="SQLServer" cookieless="UseUri" sqlConnectionString="Integrated
Security=SSPI;data source=MySqlServer;" />
Answer: C
.c
Question: 2
ne
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a custom-templated server control. You need to ensure that the child controls of the
server control are uniquely identified within the control hierarchy of the page. Which interface
should you implement?
gi
A. the ITemplatable interface
B. the INamingContainer interface
en
C. the IRequiresSessionState interface
D. the IPostBackDataHandler interface
m
Answer: B
xa
Question: 3
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework
version 3.5. You use Windows Authentication for the application. You set up NTFS file system
fe
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
el
additional step should you perform?
A. Remove the rights from the ASP.NET user to the file.
.s
B. Remove the rights from the application pool identity to the file.
C. Add the <identity impersonate="true"/> section to the Web.config file.
w
D. Add the <authentication mode="[None]"> section to the Web.config file.
w
Answer: C
w
Question: 4
You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.
The application contains a DataSet object named OrderDS that has the Order and OrderDetail
tables as shown in the following exhibit. You write the following code segment. (Line numbers are
included for reference only.)
01 private void GetOrders(SqlDataConnection cn) {
02 SqlCommand cmd = cn.CreateCommand();
03 cmd.CommandText = "Select * from [Order];
Select * from [OrderDetail];";
04 SqlDataAdapter da = new SqlDataAdapter(cmd);
05
Page 1 of 62
Exam Name: UPGRADE: Transition your MCPD Enterprise Application Developer Skills to
MCPD Enterprise Application Developer 3.5, Part 1
Exam Type: Microsoft
Exam Code: 70-568(CSharp) Total Questions: 120
06 }
You need to ensure that the Order and the OrderDetail tables are populated.
Which code segment should you insert at line 05?
om
.c
ne
gi
A. da.Fill(OrderDS);
B. da.Fill(OrderDS.Order);da.Fill(OrderDS.OrderDetail);
en
C. da.TableMappings.AddRange(new DataTableMapping[] { new DataTableMapping("Table",
"Order"), new DataTableMapping("Table1", "OrderDetail")});da.Fill(OrderDS);
D. DataTableMapping mapOrder = new DataTableMapping();mapOrder.DataSetTable =
m
"Order";DataTableMapping mapOrderDetail = new
DataTableMapping();mapOrder.DataSetTable =
xa
"OrderDetail";da.TableMappings.AddRange(new DataTableMapping[] { mapOrder,
mapOrderDetail }); Da.Fill(OrderDS);
fe
Answer: C
Question: 5
el
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. You write the following code
.s
segment. (Line numbers are included for reference only.)
w
01 using (SqlConnection connection = new
SqlConnection(connectionString)) {
02 SqlCommand cmd = new SqlCommand(queryString, connection);
w
03 connection.Open();
04
w
05 while (sdrdr.Read()){
06 // use the data in the reader
07 }
08 }
You need to ensure that the memory is used efficiently when retrieving BLOBs from the
database. Which code segment should you insert at line 04?
A. SqlDataReader sdrdr = cmd.ExecuteReader();
B. SqlDataReader sdrdr = cmd.ExecuteReader(CommandBehavior.Default);
C. SqlDataReader sdrdr = cmd.ExecuteReader(CommandBehavior.SchemaOnly);
Page 2 of 62
Exam Name: UPGRADE: Transition your MCPD Enterprise Application Developer Skills to
MCPD Enterprise Application Developer 3.5, Part 1
Exam Type: Microsoft
Exam Code: 70-568(CSharp) Total Questions: 120
D. SqlDataReader sdrdr = cmd.ExecuteReader(CommandBehavior.SequentialAccess);
Answer: D
Question: 6
You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.
The application uses a Microsoft SQL Server 2005 database. To open a connection to the
database, you write the following code segment. (Line numbers are included for reference only.)
01 private void GetOpenOrders() {
om
02 try {
03 //open SqlConnection and execute command.
04 }
05 catch (SqlException exp) {
.c
06
07 }
ne
08 }
The connection generates error messages and raises an exception. You use a ListBox control
named lstResults to display the error messages. You need to add a list item in the lstResults
gi
control for each connection-related error message returned by the SqlConnection object. What
should you do?
en
A. Insert the following code segment at line 06. foreach (SqlError error in exp.Errors) {
lstResult.Items.Add(error.Message);}
m
B. Insert the following code segment at line 06. string[] errors = exp.Message.Split(new
char[]{','});foreach (string error in errors) { if (error.IndexOf("ConnectionError:") > -1) {
lstResult.Items.Add(error); }}
xa
C. Insert the following code segment at line 06. string[] errors = exp.StackTrace.Split(new
char[]{','});foreach (string error in errors) { if (error.IndexOf("ConnectionError:") > -1) {
lstResult.Items.Add(error); }}
fe
D. Insert the following code segment at line 06. LogException(exp.Message); Add the following
method to the application. private void LogException(Exception exp) { if (exp.InnerException !=
el
null) { LogException(exp.InnerException); } lstResult.Items.Add(exp.Message);}
Answer: A
.s
Question: 7
w
You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.
The application contains a DataSet class. The DataSet class contains two tables named Order
w
and OrderDetail as shown in the following exhibit. You add a DataColumn class named
OrderTotal to the Order table. You need to ensure that the OrderTotal column stores the sum of
w
the values in the LineTotal column of the OrderDetail table. Which expression string should you
use to set the Expression property of the OrderTotal column?
Page 3 of 62
Exam Name: UPGRADE: Transition your MCPD Enterprise Application Developer Skills to
MCPD Enterprise Application Developer 3.5, Part 1
Exam Type: Microsoft
Exam Code: 70-568(CSharp) Total Questions: 120
om
.c
A. "Sum(OrderDetail.LineTotal)"
B. "Sum(Relationship.LineTotal)"
C. "Sum(Order_OrderDetail.LineTotal)"
ne
D. "Sum(Child(Order_OrderDetail).LineTotal)"
Answer: D
gi
Question: 8
en
You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.
The application has a DataTable object named OrderDetailTable. The object has the following
columns:
m
ID
OrderID
xa
ProductID
Quantity
LineTotal
fe
The OrderDetailTable object is populated with data provided by a business partner. Some of the
records contain a null value in the LineTotal field and 0 in the Quantity field. You write the
el
following code segment. (Line numbers are included for reference only.)
.s
01 DataColumn col = new DataColumn("UnitPrice", typeof(decimal));
02
w
03 OrderDetailTable.Columns.Add(col);
w
You need to add a DataColumn named UnitPrice to the OrderDetailTable object. Which line of
code should you insert at line 02?
w
A. col.Expression = "LineTotal/Quantity";
B. col.Expression = "LineTotal/ISNULL(Quantity, 1)";
C. col.Expression = "LineTotal.Value/ISNULL(Quantity.Value,1)";
D. col.Expression = "iif(Quantity > 0, LineTotal/Quantity, 0)";
Answer: D
Question: 9
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.
Page 4 of 62
Exam Name: UPGRADE: Transition your MCPD Enterprise Application Developer Skills to
MCPD Enterprise Application Developer 3.5, Part 1
Exam Type: Microsoft
Exam Code: 70-568(CSharp) Total Questions: 120
"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 ...";
om
05 }
The cmd object takes a long time to execute.
You need to ensure that the application continues to execute while cmd is executing.
.c
What should you do?
ne
A. Insert the following code segment at line 03. cmd.BeginExecuteNonQuery(new
AsyncCallback(UpdateComplete), cmd); Add the following code segment. private void
UpdateComplete (IAsyncResult ar) { int count = (int)ar.AsyncState; LogResults(count);}
B. Insert the following code segment at line 03. cmd.BeginExecuteNonQuery(new
gi
AsyncCallback(UpdateComplete), cmd); Add the following code segment. private void
UpdateComplete (IAsyncResult ar) { SqlCommand cmd = (SqlCommand)ar.AsyncState; int
en
count = cmd.EndExecuteNonQuery(ar); LogResults(count);}
C. Insert the following code segment at line 03. cmd.StatementCompleted += new
StatementCompletedEventHandler(UpdateComplete);cmd.ExecuteNonQuery(); Add the
m
following code segment. private void UpdateComplete (object sender,
StatementCompletedEventArgs e) { int count = e.RecordCount; LogResults(count);}
D. Insert the following code segment at line 03. SqlNotificationRequest notification = new
xa
SqlNotificationRequest("UpdateComplete", "", 10000);cmd.Notification =
notification;cmd.ExecuteNonQuery(); Add the following code segment. private void
UpdateComplete(SqlNotificationRequest notice) { int count = int.Parse(notice.UserData);
fe
LogResults(count);}
el
Answer: B
Question: 10
.s
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
w
of the daOrder object is set. You write the following code segment. (Line numbers are included
for reference only.)
w
01 private void ModifyDataAdapter() {
w
02
03 }
You need to ensure that the daOrder object can also handle updates.
Which code segment should you insert at line 02?
A. SqlCommandBuilder cb = new SqlCommandBuilder(daOrder);cb.RefreshSchema();
B. SqlCommandBuilder cb = new SqlCommandBuilder(daOrder);cb.SetAllValues = true;
C. SqlCommandBuilder cb = new SqlCommandBuilder(daOrder);daOrder.DeleteCommand =
cb.GetDeleteCommand();daOrder.InsertCommand =
cb.GetInsertCommand();daOrder.UpdateCommand = cb.GetUpdateCommand();
Page 5 of 62
Exam Name: UPGRADE: Transition your MCPD Enterprise Application Developer Skills to
MCPD Enterprise Application Developer 3.5, Part 1
Exam Type: Microsoft
Exam Code: 70-568(CSharp) Total Questions: 120
D. SqlCommandBuilder cb = new
SqlCommandBuilder(daOrder);cb.RefreshSchema();cb.GetDeleteCommand();cb.GetInsertCo
m and();cb.GetUpdateCo
Answer: C
Question: 11
You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.
The application reads the following contacts.xml file.
om
<contacts>
<contact contactId="2">
<firstName>Don</firstName>
<lastName>Hall</lastName>
.c
</contact>
<contact contactId="3">
ne
<firstName>Simon</firstName>
<lastName>Rapier</lastName>
</contact>
<contact contactId="4">
gi
<firstName>Shu</firstName>
<lastName>Ito</lastName>
</contact>
en
</contacts>
m
You write the following code segment. (Line numbers are included for reference only.)
01 XDocument loaded = XDocument.Load(@"C:contacts.xml");
xa
02
03 foreach (string name in q)
04 Console.WriteLine("{0}", name);
fe
You need to ensure that the application outputs only the names Simon Rapier and Shu Ito.
el
Which code segment should you insert at line 02?
A. var q = from c in loaded.Descendants("contact").Skip(1)select (string)c.Element("firstName") +
.s
" " + (string)c.Element("lastName");
B. var q = from c in loaded.Descendants("contact").Skip(0)select (string)c.Element("firstName") +
w
" " + (string)c.Element("lastName");
C. var q = from c in loaded.Descendants("contact")where c.IsAfter(c.FirstNode)select
w
(string)c.Element("firstName") + " " + (string)c.Element("lastName");
D. var q = from c in loaded.Descendants("contact")where (int)c.Attribute("contactId") < 4select
w
(string)c.Element("firstName") + " " + (string)c.Element("lastName");
Answer: A
Question: 12
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
{
Page 6 of 62
Our Microsoft 70-568 exam questions, MCPD 70-568 st more
Our Microsoft 70-568 exam questions, MCPD 70-568 study guides and practice test software take your expertise to the next level, beyond passing the 70-568 certification exam. less
0 comments
Post a comment