|
Question |
Rating |
View Answer |
|
You develop a Windows-based inventory management application that interacts with a Microsoft SQL Server database. Your application enables users to update information about items in inventory. Each time a user changes an inventory item, your application executes a SQL Server stored procedure XYZSP to update rows in the database. XYZSP will run many times during each user session. Your application will use a SqlCommand object to execute XYZSP. You must revise your code so that the use of this object optimizes query performance. What should you do? A. Call the SqlCommand.DeriveParameters method before each call to SqlCommand.ExecuteNonQuery. B. Call the SqlCommand.Prepare method before each call to SqlCommand.ExecuteNonQuery. C. Call the SqlCommand.DeriveParameters method before the first call to SqlCommand.ExecuteNonQuery. D. Call the SqlCommand.Prepare method before the first call to SqlCommand.ExecuteNonQuery.
|
|
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 create a Visual Studio .NET setup project to distribute an application. You add a SQL script named XYZDB.SQL. You must ensure that the SQL script is executed during the installation process. What should you do? A. Add a custom action to your setup project. Select XYZDB.SQL as the source path. B. Add a batch file to your setup project to execute XYZDB.SQL. Add a launch condition to the setup project. Set the Condition property to the batch file. C. Create a new Visual Studio .NET project that executes XYZDB.SQL. Include the new project with your setup project. Add a custom action that launches the new project during installation. D. Add a launch condition to your setup project. Set the Condition property to XYZDB.SQL.
|
|
View Answer |
|
You execute a query on your external Oracle database named XYZSalesDate by using an OleDbCommand object. The query uses the Average function to return a single value that represents the average price of products in the inventory table. You want to optimize performance when you execute this query. To execute this query from your ADO.NET code, you need to use a method of the OleDbCommand object. Which method should you use? A. ExecuteNonQuery B. ExecuteScalar C. ToString D. ExecuteReader
|
|
View Answer |
|
You use Visual Studio .NET to develop a Windows-based application that interacts with a Microsoft SQL Server database. Your application contains a form named CustomerForm, which includes the following design-time components: • SqlConnection object named XYZConnection. • SqlDataAdapter object named XYZDataAdapter. • DataSet object named XYZDataSet, based on a database table named Customers. At run time you add a TextBox control named textCompanyName to CustomerForm. You execute the Fill method of XYZDataAdapter to populate Customers. Now you want to use data binding to display the CompanyName field exposed by XYZDataSet in textCompanyName. Which code segment should you use? A. textCompanyName.DataBindings.Add(“Text”, XYZDataSet, “CompanyName”) B. textCompanyName.DataBindings.Add(“Text”, XYZDataSet, “Customers.CompanyName”) C. textCompanyName.DataBindings.Add(“Text”, XYZDataAdapter, “CompanyName”) D. textCompanyName.DataBindings.Add(“Text”, XYZDataAdapter, “Customers.CompanyName”).
|
|
View Answer |
|
ou develop a Windows-based application that stores and retrieves data in a Microsoft SQL Server database called XYZSales. Your application uses ADO.NET and the SqlClient managed provider. You need to identify the severity level of all errors returned from SQL Server. What should your error-handling code do? A. Catch the SqlException that is thrown when the error occurs and access the Source property. B. Catch the SqlException that is thrown when the error occurs and access the Class property. C. Examine the State property of the SqlConnection object for the status of the connection after the error occurs. D. Examine the DataSource property of the SqlConnection object for the status of the connection after the error occurs.
|
|
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 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 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 develop a customer contact application XYZContact, that will enable users to view and update customer data in a Windows Form. Your application uses a DataTable object and a DataAdapter object to manage the data and interact with a central database. Your application design must fulfill the following requirements: • After a user completes a set of updates, the changes must be written in the database. • The data stored in the DataTable object must indicate that the database updates are complete. What code segment should you use? A. DataTable.AcceptChanges() DataAdapter.Update(DataTable) B. DataAdapter.Update(DataTable) DataTable.AcceptChanges() C. DataTable.Reset() DataAdapter.Update(DataTable) D. DataAdapter.Update(DataTable) DataTable.Reset().
|
|
View Answer |
|
You use Visual Studio .NET to create an assembly, called XYZAssembly, that will be used by other applications, including a standard COM client application. You must deploy your assembly on the COM application to a client computer. You must ensure that the COM application can instantiate components within the assembly as COM components. What should you do? A. Create a strong name of the assembly by using the Strong Name tool (Sn.exe). B. Generate a registry file for the assembly by using the Assembly Registration tool (Regasm.exe) Register the file on the client computer. C. Generate a type library for the assembly by using the Type Library Importer (Tlbimp.exe). Register the file on the client computer. D. Deploy the assembly to the global assembly cache on the client computer. Add a reference to the assembly in the COM client application.
|
|
View Answer |
|
You create an assembly by using Visual Studio .NET. The assembly is consumed by other .NET applications to manage the creation and deletion of XML data files. The assembly includes a method named DeleteXYZXMLFile that uses the Win32 API to delete the XML data files. A security exception is thrown when DeleteXYZXMLFile is called from another .NET application. You must modify DeleteXMLFile to ensure that this method can execute functions exposed by the Win32 API. To do so, you create a SecurityPermission object that represents the right to call unmanaged code. Which method of the SecurityPermission object should you call? A. Assert B. Demand C. PermitOnly D. RevertDeny
|
|
View Answer |
|
You create an assembly by using Visual Studio .NET. The assembly is responsible for writing and reading order entry information to and from an XML data file. The assembly also writes and reads values to and from the Windows registry while it is being consumed. The assembly will be distributed to client computers by using your company, XYZ, intranet. All client computers are configured to implement the default .NET security policy. You need to implement security in the assembly. What should you do? A. Implement declarative security and execute the permission demand to allow access to the file system and Windows registry. B. Implement declarative security and execute the minimum permission request to allow access to the file system and Windows registry. C. Implement imperative security and execute the permission demand to allow access to the file system and Windows registry. D. Implement imperative security and execute the minimum permission request to allow access to the file system and Windows registry.
|
|
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 |
|
As a software developer at XYZ inc. you use Visual Studio .NET to create a Windows-based application. You need to make the application accessible to users who have low vision. These users navigate the interface by using a screen reader, which translates information about the controls on the screen into spoken words. The screen reader must be able to identify which control currently has focus. One of the TextBox controls in your application enables users to enter their names. You must ensure that the screen reader identifies this TextBox control by speaking the word "name" when a user changes focus to this control. Which property of this control should you configure? A. Tag B. Next C. Name D. AccessibleName E. AccessibleRole
|
|
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 |
|
Question: 47. (A) You develop a Windows Form that provides online help for users. You want the help functionality to be available when users press the F1 key. Help text will be displayed in a pop-up window for the text box that has focus. To implement this functionality, you need to call a method of the HelpProvider control and pass the text box and the help text. Which method should you call? A. SetShowHelp B. SetHelpString C. SetHelpKeyword D. ToString
|
|
View Answer |
|
You develop a Windows-based application that contains a class named Contact. Contact contains an event named ContactSaved. Many Contact objects will be created from the Contact class and inserted into an array named Contacts. You create a custom method named HandleContactSaved in your application. You must ensure that your application calls HandleContactSaved whenever the ContactSaved event is fired for any of the Contact objects. What should you do? A. Use the WithEvents keyword to declare each Contact object. Add each Contact object to the Contacts array as it is created. B. Add each Contact object to the Contacts array as it is created Add the Handles keyword to HandleContactSaved. C. Add each Contact object to the Contacts array as it is created. Assign HandleContactSaved to the Handle property of the HandleRef structure. D. Add each Contact Object to the Contacts array as it is created. Call the AddHandler statement and pass the new Contact object and the address of HandleContactSaved.
|
|
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-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 |