Which code segment should you use?
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 application throws an exception when the SQL Connection object is used. You need to handle the exception.
Which code segment should you use?
Which two actions should you perform?
You are creating a Windows Forms application by using the .NET Framework 3.5.
The application is used to print employee records. You plan to create a customized Print Preview dialog box in the application.
You need to ensure that users can preview their documents before printing.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
Which code segment should you use?
You are creating a Windows Forms application by using the .NET Framework 3.5.
You have implemented the PrintPage event to send the page output to the printer.
The users must select the printer and the page range before printing.
You need to ensure that users can print the content of the form by clicking the button control.
Which code segment should you use?
Which code segment should you use?
You are developing a component by using the .NET Framework 3.5.
The component will be distributed with a Windows Forms application.
The component provides a method named PrintPayroll. The method is used to print payroll information to a dedicated printer without the intervention of the user.
The component will be installed with full trust on the computer of the user.
The component is occasionally called by the applications by using restricted permissions.
You need to ensure that the component can print without granting additional permissions to the calling application.
Which code segment should you use?
Which code segment should you use?
You are creating a Windows Forms application by using the .NET Framework 3.5.
The Windows application will provide print functionality to the users. You implement the PrintPage page event for a form.
The users must be able to print the pages by using the Landscape orientation.
You need to ensure that the users can set the page settings before printing.
Which code segment should you use?
Which code segment should you use?
You are creating a Windows Forms application by using the .NET Framework 3.5.
The application is configured to use role-based security. You need to ensure that users can print reports only by selecting a printer from the printer dialog box.
You want to achieve this goal by using the minimum level of permission.
Which code segment should you use?
Which code segment should you use?
You are creating a Windows Forms application for the design of circuit boards and electronic equipment.
You use the .NET Framework 3.5 to create the application. You are creating a custom dialog box that allows designers to preview designs before printing them.
The previewed documents must meet the following requirements:
* The graphics and text are displayed clearly.
* The full-scale preview is set as default for the documents.
* The zoom setting of the preview control is adjusted automatically when the form is resized.
You need to ensure that the requirements are met when the form that contains the custom print preview control is displayed.
Which code segment should you use?
Which code segment should you use?
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?
Which code segment should you use?
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?
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?