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?
Which code segment should you use?
You are creating a Windows Forms application for inventory management by using the .NET Framework 3.5.
The application provides a form that allows users to maintain stock balances. The form has the following features:
* A dataset named dsStockBalance to store the stock information.
* A business component named scInventory
* The scInventory component provides a method named Save.
* You need to ensure that only the modified stock balances of dsStockBalance are passed to the scInventory.Save method.
Which code segment should you use?
Which code segment should you add at line 02?
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 = "SELECT CategoryID, CategoryName FROM Categories";
02
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 02?