1.
You are creating a Windows Forms application by using the .NET Framework 3.5.
The application requires a form to display a clock. You need to create a circular form to display the clock.
Which code segment should you use:
2.
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 SplitContainer control named spcFrame to the form. The
SplitContainer control has two SplitterPanel controls named Panel1 and Panel2. You are configuring the
SplitContainer control to define the layout of the form. You need to ensure that the following requirements are met:
The initial distance from the left edge of the spcFrame splitter is set to 200 pixels.
The size of the Panel2 SplitterPanel remains unchanged when the form is resized.
Which code segment should you use
3.
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
4.
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 }
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
5.
You are creating a Windows Forms application by using the .NET Framework 3.5.
You plan to modify a list of orders within a DataGridView control in the application. You need to ensure that a value is required in the first column of the grid control. Which code segment should you use
6.
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
7.
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
8.
You are creating a Windows Forms application by using the .NET Framework 3.5.
You need to populate a list box control along with category names by using a DataReader control. Which code segment should you use
9.
You are creating a Windows Forms application by using the .NET Framework 3.5.
The application stores a list of part numbers in an integer-based array as shown in the following code segment.
(Line numbers are included for reference only.)
01 var parts = new int[]
02 { 105, 110, 110, 235, 105,
03 135, 137, 205, 105, 100, 100 };
04
05 foreach (var item in results) {
06 tbResults.Text += item + "\r\n";
07 }
You need to use a LINQ to Objects query to perform the following tasks:
Obtain a list of duplicate part numbers.
Order the list by part numbers.
Provide the part numbers and the total count of part numbers in the results.
Which code segment should you insert at line 04
10.
You are creating a Windows Forms application by using the .NET Framework 3.5.
You use LINQ expressions to read a list of customers from the following XML file.
Paul Koch
Bob Kelly
Joe Healy
Matt Hink
Tom Perham
Jeff Hay
Kim Shane
Mike Ray

You need to obtain a list of names of customers who are 21 years of age or older. Which code segment should you use