PrepAway - Latest Free Exam Questions & Answers

Category: 70-320

Exam 70-320: Developing XML Web Services and Server Components with Microsoft Visual C# .NET and the Microsoft .NET Framework

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 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.)

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?

How many connection pools are created?

You develop an ADO.NET application that uses a Microsoft SQL Server database and a SqlClient data provider. Your application includes the following four code segments, which are each called once:

SqlConnection myConnection1 = new SqlConnection();
myConnection1.ConnectionString = “Data Source=ProdServer;” + “Initial Catalog=Billing;Integrated Security=true”;
myConnection1.Open();

SqlConnection myConnection2 = new SqlConnection();

myConnection2.ConnectionString = “Data Source=ProdServer;” + “Initial Catalog=Billing;Integrated Security=true”;
myConnection2.Open();

SqlConnection myConnection3 = new SqlConnection();
myConnection3.ConnectionString =
“Data Source=SearchServer;”
+ “Initial Catalog=Search;Integrated Security=true”;
myConnection3.Open();

SqlConnection myConnection4 = new SqlConnection();
myConnection4.ConnectionString = “Data Source=ProdServer;” + “Initial Catalog=OrderEntry;Integrated Security=true”;
myConnection4.Open();

You verify that your application is the only application that is using SQL Server. Your application runs all code segments by using the same identity.

You run the application. Connection pooling is enabled, and the entire application runs within the
connection timeout parameter.

How many connection pools are created?

Which code segment should you use?

You have a DataSet object named myDataSet that is populated with data from a Microsoft SQL Server database. This object contains insertions, deletions, and updates to the data. You want to apply the data changes in myDataSet to the database. You decide to use the SqlClient
data provider. You need to create a data object that you will use to update the database. Which code segment should you use?


Page 4 of 9« First...23456...Last »