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 code segment should you insert at line 04?

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 segment. (Line numbers are included for reference only.)
01 using (SqlConnection connection = new SqlConnection(connectionString)) {
02 SqlCommand cmd = new SqlCommand(queryString, connection);
03 connection.Open();
04
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?

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?

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?

Which code segment should you add at line 02?

You are creating a Windows Forms application by using the .NET Framework 3.5. You
create a new form in the application. You add a ContextMenuStrip control named ctxMenu
to the form.You have a user-defined class named CustomControl.You write the following
code segment in the application. (Line numbers are included for reference only.)
01 CustomControl myControl = new CustomControl();
02 You need to ensure that an instance of CustomControl is displayed on the form as a top-
level item of thectxMenu control.
Which code segment should you add at line 02?


Page 12 of 12« First...89101112