Which code segment should you use?
You are creating an XML Web service named InventoryService for a national automobile dealership. Each branch of the dealership will build its own client application to consume InventoryService. Each branch connects to the main office of the dealership by using a virtual private network (VPN). All computers in the dealership run on Microsoft Windows operating systems.
You need to ensure that callers of InventoryService are authenticated based on their Windows logon name and password. You configure Internet Information Services (IIS) according to your security needs. You need to configure the authentication type in the Web.config file.
Which code segment should you use?
You need to make the user name and password available to a custom Installer class that will execute the script
You are preparing to deploy an XML Web service named InventoryService. This service queries a Microsoft SQL Server database and returns information to the caller.
You use Visual Studio .NET to create a setup project. You need to install InventoryService. You also need to run a script to create the necessary SQL Server database and tables to store the data. To accomplish this, you need to configure the project to have administrator rights to the SQL Server database.
You add a custom dialog box to the project that prompts the user for the administrator user name and password that are used to connect to the SQL Server database. You need to make the user name and password available to a custom Installer class that will execute the script.
What should you do?
Which code segment should you use?
You are developing an application to monitor store inventory. When inventory falls below a specified level, the application automatically generates a purchase request. Suppliers have requested that you transmit purchase requests to them in an XML document. Suppliers will accept the XML document in any valid form, except they do not want the data set definition to be
included in the XML file.
You create a method named GeneratePurchaseRequest. You write the code to populate a DataSet object named myDataSet with the purchase request data. You define a variable named fileName that contains the name and path of the output file.
You need to create an XML file from the data in myDataSet by adding code to GeneratePurchaseRequest. You want to accomplish this task by writing the minimum amount of code.
Which code segment should you use?
Which XML output is produced by this code segment?
You are troubleshooting a Visual Studio .NET application that was developed by a former colleague. You find the following code segment within a large assembly:
XmlElement theElement;
XmlElement anotherElement;
XmlDocument doc = new XmlDocument();
XmlDeclaration theDecl =
doc.CreateXmlDeclaration(“1.0”,null,null);
doc.AppendChild(theDecl);
theElement = doc.CreateElement(“Library”);
doc.AppendChild(theElement);
theElement = doc.CreateElement(“Book”);
theElement.SetAttribute(“type”,”Mystery”);
anotherElement = doc.CreateElement(“Title”);
anotherElement.InnerText = “Book Title”;
anotherElement.AppendChild(theElement);
doc.DocumentElement.AppendChild(theElement);
Which XML output is produced by this code segment?
What should you do?
You are developing an application that queries a table named Products in a Microsoft SQL Server database. The query will be stored in a string variable named sqlQuery. The query includes the following SQL code:
SELECT * FROM Products FOR XML AUTO
You must iterate the query results and populate an HTML table with product information.
You must ensure that your application processes the results as quickly as possible.
What should you do?
Which code segment should you use?
You have a DataSet object named customersDataSet that contains a DataTable object named Customers. Customers retrieves information from a Microsoft SQL Server database. Customers contains a column named Region. You want to create a DataView object named customersDataView that contains only customers in which the value in the Region column is France.
Which code segment should you use?
Which two actions should you take? (Each correct answer presents part of the solution
You are planning to create a DataSet object named myDataSet to be used in a bond-trading application. Several developers will need to write code to manipulate myDataSet, and you want to ensure that myDataSet is easy for them to use. You decide to create myDataSet as a strongly typed data set. Which two actions should you take? (Each correct answer presents part of the solution.
Choose two.)
Which code segment should you use?
You have a SqlDataReader object named ordersDataReader. This object contains a column named OrderQuantity as an integer value. This object also contains one row for each order received during the previous week. You need to write code that will process each row in ordersDataReader and pass OrderQuantity to a function named myFunction. Which code segment should you use?
You need to ensure that you can use the Find method to accomplish this goal
You have a DataSet object that contains a single DataTable object named Employees. Employees has a column named EmployeeID. EmployeeID contains no duplicate data.
You are creating a function that accepts a parameter of EmployeeID and searches Employees to return the DataRow object for the specified EmployeeID.
You want to use the Find method of the rows collection in Employees to return the requested DataRow object from the function. You need to ensure that you can use the Find method to accomplish this goal.
What should you do?
Which code segment should you use?
You are developing an application that retrieves a list of geographical regions from a table in a Microsoft SQL Server database. The list of regions is displayed in a drop-down list box on a Windows Form.
You want to populate the list box with data from a DataSet object. You want to fill the DataSet object by using a SqlDataAdapter object.
You create a SqlConnection object named myConnection and a SQL query string named regionSQL. You need to write the code to create the SqlDataAdapter object.
Which code segment should you use?