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 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?

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?

Which code segment should you use?

You are creating a Windows Forms application by using the .NET Framework 3.5. You write
a code segment to connect to a Microsoft Access database and populate a DataSet.You need
to ensure that the application meets the following requirements:
It displays all database exceptions.
It logs all other exceptions by using the LogExceptionToFile.
Which code segment should you use?

What should you do?

You are creating a Windows Forms application by using the .NET Framework 3.5. You
create a new form in your application. You add a PrintDocument control named pntDoc to
the form.To support the print functionality, you write the following code segment in the
application. (Line numbers are included for reference only.)
01 pntDoc.BeginPrint += new PrintEventHandler(PrintDoc_BeginPrint);
02 …
03 bool canPrint = CheckPrintAccessControl();
04 if (!canPrint) {
05
06 }
07
You need to ensure that the following requirements are met:
When the user has no print access, font and file stream initializations are not
executed and the print operation is cancelled.
Print operations are logged whether or not the user has print access.
What should you do?

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?

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?

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?

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?

Which code segment should you insert at line 16?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET. The application uses Microsoft SQL Server 2005.You write the following code
segment. (Line numbers are included for reference only.)
01 String myConnString = “User
02 ID=<username>;password=<strong password>;Initial
03 Catalog=pubs;Data Source=myServer”;
04 SqlConnection myConnection = new
05 SqlConnection(myConnString);
06 SqlCommand myCommand = new SqlCommand();
07 DbDataReader myReader;
08 myCommand.CommandType =
09 CommandType.Text;
10 myCommand.Connection = myConnection;
11 myCommand.CommandText = “Select * from Table1; Select * from Table2;”;
12 int RecordCount = 0;
13 try
14 {
15 myConnection.Open();
16
17 }
18 catch (Exception ex)
19 {
20 }
21 finally
22 {
23 myConnection.Close();
24 }
You need to compute the total number of records processed by the Select queries in the
RecordCount variable.Which code segment should you insert at line 16?

Which code segment should you use?

You are creating a Windows Forms application by using the .NET Framework 3.5. You write
a code segment to connect to a Microsoft Access database and populate a DataSet.You need
to ensure that the application meets the following requirements:
It displays all database exceptions.
It logs all other exceptions by using the LogExceptionToFile.
Which code segment should you use?


Page 1 of 1212345...10...Last »