PrepAway - Latest Free Exam Questions & Answers

Category: 70-566

Exam 70-566: UPGRADE: Transition your MCPD Windows Developer Skills to MCPD Windows Developer 3.5

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 the ctxMenu control. Which code segment should you add at line 02?

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?

recommend?

You are creating a Windows application by using the .NET Framework 3.5. The application is used to schedule appointments. The application contains a scheduling component that will perform the following tasks:

* Return available appointments.
* Add a new appointment to a calendar.
* The initial implementation of the scheduling component must be deployed.

You need to recommend a strategy to allow replacement of the scheduling component without changing compiled code. Which three actions should you
recommend? (Each correct answer presents part of the solution. Choose three.)

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 BYCategoryName”, cnnNorthwind);
03 OleDbDataAdapter daCategory = newOleDbDataAdapter(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?

Which code fragment should you add on Line 07?

You are creating a Windows Forms application by using the .NET Framework 3.5. You write the following code segment to update multiple databases on a SQL Server 2008 database. (Line numbers are included for reference only.)

01 string connectionStringCustomer = @”DataSource=CUSTOMER;Integrated Security= SSPI;”;
02 string connectionStringOrders = @”Data Source=ORDER;Integrated Security= SSPI;”;
03 SqlCommand cmdCustomer = new SqlCommand();
04 SqlCommand cmdOrders = new SqlCommand();
05 SqlConnection cnnCustomer =new SqlConnection(connectionStringCustomer);
06 SqlConnection cnnOrders =new SqlConnection(connectionStringOrders);
07

You need to ensure that all database updates are included in a single distributed transaction.Which code fragment should you add on Line 07?


Page 6 of 9« First...45678...Last »