|
Question |
Rating |
View Answer |
|
You develop a Windows-based application XYZInvoice that enables users to enter and edit customer orders. XYZInvoice contains a DataSet object named orderEntryDataSet and DataTable object named orderDataTable and orderDetailDataTable. The orderDetailDataTable requires two columns to make a unique primary key. You need to define a primary key for orderDetailDataTable. What should you do? A. Set the DataTable.PrimaryKey property to a string value that lists the column names that make the primary key. B. Set the DataTable.PrimaryKey property to an array of DataColumn objects that reference the columns that make the primary key. C. Iterate through the DataTable.Columns collection and set the DataType property of the columns that make the primary key. D. Create a UniqueConstraint on the columns that make the primary key.
|
|
View Answer |
|
You are preparing a localized version of a Windows Form named XYZLocal. Users of XYZLocal speak a language that prints text from right to left. User interface elements on the form need to conform to this alignment. You must ensure that all user interface elements are properly formatted when the localized Windows Form runs. You must also ensure that XYZLocal is easy to update and maintain. What should you do? A. Set the RightToLeft property of each control on the form to Yes. B. Set the RightToLeft property of the form to Yes. C. Set the Language property of the form to the appropriate language. D. Set the Localizable property of the form to True.
|
|
View Answer |
|
You use Visual Studio .NET to develop a Windows-based application. Your application includes a form named XYZInformationForm, which enables users to edit information stored in a database. All user changes to this information must be saved in the database. You need to write code that will prevent XYZInformationForm from closing if any database changes are left unsaved. What should you do?. A. Include Me.Activate in the Closing event handler of XYZInformationForm. B. Include Me.Activate in the Closed event handler of XYZInformationForm. C. Include Me.Activate in the Leave event handler of XYZInformationForm. D. Change a property of the System.ComponentModel.CancelEventArgs parameter in the Closing event handler of XYZInformationForm. E. Change a property of the System.EventArgs parameter in the Closed event handler of XYZInformationForm. F. Change a property of the System.EventArgs parameter in the Leave event handler of XYZInformationForm.
|
|
View Answer |
|
You develop a Windows-based application that contains a form named ContactXYZ. You need to write code to initialize all class-level variables in ContactXYZ as soon as ContactXYZ is instantiated. You will place your code in a public procedure in the ContactXYZ class. Which public procedure should you use? A. Create B. Initialize C. Load D. New
|
|
View Answer |
|
As a software developer at XYZ you use Visual Studio .NET to create a Windows-based application. The application enables users to update customer information that is stored in a database. Your application contains several text boxes. All TextBox controls are validated as soon as focus is transferred to another control. However, your validation code does not function as expected. To debug the application, you place the following line of code in the Enter event handler for the first text box: Trace.WriteLine (“Enter”) You repeat the process for the Leave, Validated, Validating, and TextChanged events. In each event, the text is displayed in the output window contains the name of the event being handled. You run the application and enter a value in the first TextBox control. Then you change focus to another control to force the validation routines to run. Which code segment will be displayed in the Visual Studio .NET output windows? A. Enter Validating TextChanged Leave Validated B. Enter TextChanged Leave Validating Validated C. Enter Validating Validated TextChanged Leave D. Enter TextChanged Validating Validated Leave E. Enter Validating TextChanged Validated Leave
|
|
View Answer |
|
You use Visual Studio .NET to create an application. Your application contains two classes, Region and City, which are defined in the following code segment. (Line numbers are included for reference only.) 01 Public Class Region 02 Public Overridable Sub CalculateTax() 03 'Code to calculate tax goes here. 04 End Sub 05 End Class 06 Public Class City 07 Inherits Region 08 Public Overrides Sub CalculateTax() 09 'Insert new code. 10 End Sub 11 End Class You need to add code to the CalculateTax method of the City class to call the CalculateTax method of the Region class. Which code segment should you add on line 9? A. CalculateTax() B. Me.CalculateTax() C. MyBase.CalculateTax() D. MyClass.CalculateTax()
|
|
View Answer |
|
You develop an order entry application XYZOrderEntry. XYZOrderEntry uses a DataSet object named CurrentEXOrders to maintain data in memory while users modify the data. To CurrentEXOrders, you add DataTable object named Orders and OrderDetails. OrderDetails contains data about each line item that is included in the order. Users frequently discover that an order contains no entries in OrderDetails. In these situations they delete the order from Orders. You must ensure that users cannot delete any orders that have corresponding entries in OrderDetails. What should you do? A. Add a UniqueConstraint object to CurrentEXOrders. B. Add a ForeignKeyConstraint object to CurrentEXOrders. C. Add a DataRelation object to CurrentEXOrders and set the ChildKeyConstraint property to point to the appropriate column. D. Add a DataRelation object to CurrentEXOrders and set the ParentKeyConstraint property to the appropriate column.
|
|
View Answer |
|
You use Visual Studio .NET to develop a Windows-based application that will interact with a Microsoft SQL Server database. Your application will display employee information from a table named XYZEmployees. You use ADO.NET to access the data from the database. To limit the possibility of errors, you must ensure that any type of mismatch errors between your application code and the database are caught at compile time rather than at run time. Which two actions should you take? (Each correct answer presents part of the solution. Choose two) A. Create an XML schema for XYZEmployees. B. Create an XML style sheet for XYZEmployees. C. Create an XML namespace for XYZEmployees. D. Create a typed DataSet object based on the XML schema. E. Create a typed DataSet object based on the XML style sheet. F. Create a TypeDelegator class based on the XML namespace.
|
|
View Answer |
|
You develop a Windows-based application that includes the following code segment. (Line numbers are included for reference only.) 01 Public Sub password_Validating (ByVal sender As _ 02 Object, ByVal e As _. 03 System.ComponentModel.CancelEventArgs) 04 Handles password.Validating 05 If ValidPassword() = False Then 06 'Insert new code. 07 End If 08 End Sub You must ensure that users cannot move control focus away from textPassword if ValidPassword returns a value of False. You will add the required code on line 6. Which code segment should you use? A. e.Cancel = True B. sender = textName C. password.AcceptsTab = False D. password.CausesValidation =False
|
|
View Answer |
|
You develop a Windows control named FormattedTextBox, which will be used by many developers in your company. FormattedTextBox will be updated frequently. You create a custom bitmap image named CustomControl.bmp to represent FormattedTextBox in the Visual Studio .NET toolbox. The bitmap contains the current version number of the control, and it will be updated each time the control is updated. The bitmap will be stored in the application folder. If the bitmap is not available, the standard TextBox control bitmap must be displayed instead. Which class attribute should you add to FormattedTextBox? A. <ToolboxBitmap(GetType(TextBox))< _ Class FormattedTextBox B. <ToolboxBitmap(“CustomControl.bmp”)> _ Class FormattedTextBox C. <ToolboxBitmap(GetType(TextBox), _ “ CustomControl.bmp”)> _ Class FormattedTextBox D. <ToolboxBitmap(GetType(TextBox))> _ <ToolboxBitmap(“CustomControl.bmp”)> _ Class FormattedTextBox
|
|
View Answer |
|
You use Visual Studio .NET to create a component named Request. This component includes a method named AcceptRequest, which tries to process new user requests for services. AcceptRequest calls a private function named Validate. You must ensure that any exceptions encountered by Validate are bubbled up to the parent form of Request. The parent form will then be responsible for handling the exceptions. You want to accomplish this goal by writing the minimum amount of code. What should you do? A. Use the following code segment in AcceptRequest: Me.Validate() B. Use the following code segment in AcceptRequest: Try Me.Validate() Catch ex As Exception Throw ex End Try C. Use the following code segment in AcceptRequest: Try Me.Validate() Catch ex As Exception Throw new Exception ("Exception in AcceptRequest", ex) End Try D. Create a customer Exception class named RequestException by the following code segment: Public Class RequestException Inherits System.ApplicationException Public Sub New() End Sub Public Sub New (message As String) MyBase.New(message) End Sub Public Sub New (message As String, inner As Exception) MyBase.New(message, inner) End Sub End class In addition, use the following code segment in AcceptRequest: Try Me.Validate() Catch ex As Exception Throw new RequestException("Exception in _ AcceptRequest", ex) End Try
|
|
View Answer |
|
You use Visual Studio .NET to develop a Windows-based application for your human resources (HR) department. The HR department has two subdivisions named Benefits and Employee Information. The Benefits subdivision includes the Vacation group. Both subdivisions will use your application. You plan to create four forms modeled after the organizational structure of the HR department. The forms will be named HR, EmployeeInformation, Benefits, and Vacation. The forms must be arranged in a hierarchy so that each form includes all code and controls found on the forms above it in the hierarchy. The form at the top of the hierarchy will be a standard Windows Form. The form must also adhere to the following rules: • All forms should include code to access the general HR database. • Only forms used by the Benefits subdivision should have access to the Benefits database table. • The forms used by the Employee Information subdivision should have access to the EmployeeInformation database table. • The forms used by the Vacation group should include custom code to calculate vacation time. Now you must create the form hierarchy. Which code segment should you use? A. Public Class HR Inherits System.Windows.Forms.Form End Class Public Class Benefits Inherits System.Windows.Forms.Form Implements HR End Class Public Class Vacation Inherits System.Windows.Forms.Form Implements Benefits End Class Public Class EmployeeInformation Inherits System.Windows.Forms.Form Implements HR End Class B. Public Class HR Inherits System.Windows.Forms.Form End Class Public Class Benefits Inherits System.Windows.Forms.Form Implements HR End Class Public Class Vacation Inherits System.Windows.Forms.Form Implements Benefits End Class Public Class EmployeeInformation Inherits System.Windows.Forms.Form Implements Benefits End Class C. Public Class HR Inherits System.Windows.Forms.Form End Class Public Class Benefits Inherits HR End Class Public Class Vacation Inherits Benefits End Class Public Class EmployeeInformation Inherits HR. End Class D. Public Class Hr Inherits System.Windows.Forms.Form End Class Public Class Benefits Inherits HR End Class Public Class Vacation Inherits Benefits End Class Public Class EmployeeInformation Inherits Benefits End Class
|
|
View Answer |
|
You create a Windows Form named XYZForm. The form enables users to maintain database records in a table named XYZ. You need to add several pairs of controls to XYZForm. You must fulfill the following requirements: • Each pair of controls must represent one column in the XYZ table. • Each pair must consist of a TextBox control and a Label control. • The LostFocus event of each TextBox control must call a procedure named UpdateDatabase. • Additional forms similar to XYZForm must be created for other tables in the database. • Application performance must be optimized. • The amount of necessary code must be minimized. What should you do? A. Create and select a TextBox control and a Label control. Write the appropriate code in the LostFocus event of the TextBox control. Repeatedly copy and paste the controls into XYZForm until every column in the XYZ table has a pair of controls. Repeat this process for the other forms. B. Add a TextBox control and a Label controls to XYZForm. Write the appropriate code in the LostFocus event of the TextBox control. Create a control array form the TextBox control and the Label control. At run time, add additional pairs of controls to the control array until every column in the XYZ table has a pair of controls. Repeat this process for the other forms. C. Create a new user control that includes a TextBox control and a Label control. Write the appropriate code in the LostFocus event of the TextBox control. For each column in the XYZ table, add one instance of the user control to the XYZForm. Repeat this process for the other forms. D. Create a new ActiveX control that includes a TextBox control and a Label control. For each column in the XYZ table, add one instance of the ActiveX control to XYZForm. Repeat this process for the other forms.
|
|
View Answer |
|
ou use Visual Studio .NET to create a Windows-based application for online gaming. Each user will run the client version of the application on his or her local computer. In the game, each user controls two groups of soldiers, Group 1 and group 2. You create a top-level menu item whose caption is Groups. Under this menu, you create two submenus. One is named group1Submenu, and its caption is Group 1. The other is named group2Submenu, and its caption is Group2. When the user selects the Groups menu. The two submenus will be displayed. The user can select only one group of soldiers at a time. You must ensure that a group can be selected either by clicking the appropriate submenu item or by holding down the ALT key and pressing 1 or 2. You must also ensure that the group currently select will be indicated by a dot next to the corresponding submenu item. You do not want to change the caption text of any of your menu items. Which for actions should you take? (Each correct answer presents part of the solution. Choose four) A. Set group1Submenu.Text to "Group &1". Set group2Submenu.Text to "Group &2". B. Set Group1.ShortCut to "ALT1". Set Group2.ShortCut to "ALT2". C. In the group1Submenu.Click event, place the following code segment: group1Submenu.DefaultItem = True In the group2Submenu.Click event, place the following code segment: group2Submenu.DefaultItem = True D. In the group1Submenu.Click event, place the following code segment: group2Submenu.DefaultItem = False In the group2Submenu.Click event, place the following code segment: group1Submenu.DefaultItem = False E. In the group1Submenu.Click event, place the following code segment: group1Submenu.Checked = True In the group2Submenu.Click event, place the following code segment: group2Submenu.Checked = True F. In the group1Submenu.Click event, place the following code segment: group2Submenu.Checked = False In the group2Submenu.Click event, place the following code segment: group1Submenu.Checked = False G. Set group1Submenu.RadioCheck to True.
|
|
View Answer |
|
Your development team is creating a new Windows-based application for the XYZ company. The application consists of a user interface and several XML Web services. You develop all XML Web services and perform unit testing. Now you are ready to write the user interface code. Because some of your servers are being upgraded, the XML Web service that provides mortgage rates is currently offline. However, you have access to its description file. You must begin writing code against this XML Web service immediately. What should you do? A. Generate the proxy class for the XML Web service by using Disco.exe. B. Generate the proxy class for XML Web service by using Wsdl.exe. C. Obtain a copy of the XML Web service assembly and register it on your local development computer. D. Add the description file for the XML Web service to your Visual Studio .NET project.
|
|
View Answer |
|
You use Visual Studio .NET to develop a Windows-based application. The application includes several menu controls that provide access to most of the application’s functionality. One menu option is named calculateOption. When a user chooses this option, the application will perform a series of calculations based on information previously entered by the user. To provide user assistance, you create a TextBox control named XYZHelp. The corresponding text box must display help information when the user pauses on the menu option with a mouse or navigates to the option by using the arrow keys. You need to add the following code segment: XYZHelp.Text = “This menu option calculates the result..”; In which event should you add this code segment? A. calculateOption_Click B. calculateOption_Popup C. calculateOption_Select D. calculateOption_DrawItem E. calculateOption_MeasureItem
|
|
View Answer |
|
You develop a Windows-based application XYZ App by using Visual Studio .NET. XYZApp implements ADO.NET objects to call Microsoft SQL Server stored procedures. Your database administrator is responsible for coding and maintaining all stored procedures. Periodically, the administrator modifies the stored procedures. At run time, your application code must discover any changes in the way that values are passed to and returned from the stored procedures. Which ADO.NET object and method should you use? A. CommandBuilder.RefreshSchema B. CommandBuilder.DeriveParameters C. SqlCommand.CreateParameter D. SqlDataAdapter.GetFillParameters
|
|
View Answer |
|
You use Visual Studio .NET to create a custom control named XYZStats. XYZStats will operate by periodically polling your network and updating the network statistics displayed to each user. XYZStats contains a Timer control named Timer1. You set the control’s Interval property to 500 milliseconds. You write code in the Tick event handler for Timer1 to poll the network status. You also create a procedure named RedrawControl to update the statistics displayed in XYZStats. When the form that contains XYZStats is minimized or hidden behind another window, the control should not consume unnecessary resources by updating the display. You must ensure that this condition is met. In addition, you want to write the minimum amount of code needed to finish developing Stats. Which two actions should you take? (Each correct answer presents part of the solution. Choose two) A. Place the following code segment in the Tick event handler for Timer1: RedrawControl() B. Place the following code segment in the Tick event handler for Timer1: Me.Invalidate() C. Place the following code segment in the Paint event handler for Timer1: If Me.Visible = True Then Me.Invalidate() D. Place the following code segment in the Tick event handler for Timer1: If Me.Visible = True Then Me.Invalidate() E. Place the following code segment in the Paint event handler for Stats: RedrawControl(1) F. Place the following code segment in the Paint event handler for Stats: Me.Invalidate
|
|
View Answer |
|
You need to create an OleDbCommand object to retrieve information about postal codes for your mailing list application. You create an OleDbConnection object named conn. You need to instantiate the OleDBCommand object and set the CommandText and Connection properties. What are two possible code segments for you to use? (Each correct answer presents a complete solution. Choose two) A. Dim comm As New OleDbCommand() omm.CommandText = “SELECT * FROM Regions” comm.Connection = conn B. Dim comm. As New OleDbCommand(“sp_GetRegions”, conn) comm.CommandType = CommandType.Text C. Dim comm As New OleDbCommand(“SELECT * FROM Regions”, _ conn) comm.CommandType = CommandType.Text D. Dim comm As New OleDbCommand(“sp_GetRegions”, conn) comm.CommandType = CommandType.TableDirect E. Dim comm As New OleDbCommand() comm.CommandType = “SELECT * FROM Regions” comm.Connection = conn
|
|
View Answer |
|
You use Visual Basic .NET to develop a Windows-based application. You plan to reuse a procedure written in Visual Basic 6.0. The procedure includes the following array declaration: Dim Employees(1 to 10) As String You copy and paste the array declaration from the Visual Basic 6.0 project into the new Visual Basic .NET project. Now you must ensure that the Employees array will compile in the Visual Basic .NET application. What should you do? A. Include the Option Base 1 statement in the Declaration section of the module. B. Include the Option Base 0 statement in the Declaration section of the module. C. Replace the Dim statement with the following code segment: Dim Employees(0 to 9) As String D. Replace the Dim statement with the following code segment: Dim Employees(9) As String E. After the Dim statement, add the following code segment: ReDim Employees(0 to 9) As String F. After the Dim statement, add the following code segment: ReDim Employees(9) As String
|
|
View Answer |