Searching for "st"

Q:

You create English, French, and German versions of a test engine ASP.NET application you are developing for XYZ Inc. You have separate resource files for each language version.You need to deploy the appropriate resource file based on the language settings of the server. What should you do?

A) Create an installer and set the Installer.Context property for each version of your application. B) Create an installer that has a launch condition to verify the locale settings.
C) Create an installer that has a custom action to install only location-specific files. D) Create an installer that has an MsiConfigureProduct function to install the appropriate version.
 
Answer & Explanation Answer: C) Create an installer that has a custom action to install only location-specific files.

Explanation:

Custom actions are a Windows Installer feature that allows you to run code at the end of an installation to perform actions that cannot be handled during installation. This is an appropriate solution for this scenario as we only want to deploy the resource files on the server. 

 

Incorrect Answers:

 

A: We just want to deploy the resource files. We do not need to set the Context property in the application.

 

B: We don’t need any launch conditions. We just want to deploy the resource files.

 

D: We just want to deploy the resource files.

Report Error

View Answer Report Error Discuss

Q:

You are creating an ASP.NET application for XYZ. The company data is stored in a Microsoft SQL Server 6.5 database. Your application generates accounting summary reports based on transaction tables that contain million of rows.


You want your application to return each summary report as quickly as possible. You need to configure your application to connect to the database and retrieve the data in a away that achieves this goal.


What should you do?

A) Use a SqlConnection object to connect to the database, and use a SqlCommand object to run a stored procedure that returns the data. B) Use an OleDbConnection object to connect to the database, and use an OleDbCommand object to run a stored procedure that returns the data.
C) Configure SQL Server to support HTTP access, and create an XML template to run a stored procedure that returns the data in XML format. D) Use COM interop to create an ADODB.Connection object, and use an ADODB.Command object to run a SQL statement that returns the data.
 
Answer & Explanation Answer: B) Use an OleDbConnection object to connect to the database, and use an OleDbCommand object to run a stored procedure that returns the data.

Explanation:

We need to use an OleDBConnection to connect to SQL Server Version 6.5 (or earlier). 

 

Incorrect Answers:

 

A: We could use a SqlConnection object only if the SQL Server were SQL Server 7.0, 2000 or later.

 

C: HTTP functionality is not required in this scenario. It would introduce unnecessary overhead.

 

D: ADODB is a legacy standard and should not be used here

Report Error

View Answer Report Error Discuss

Q:

You are creating an ASP.NET page for selling movie tickets. Users select a region, and then they select from a list of cities in that region. The site displays the names and locations of movie theaters in the city selected by the user.


Your company, XYZ Brothers, maintains a list of theaters in a database table that includes the city, name, and street address of each theater. You want to minimize the time required to retrieve and display the list of theater names after a user selects the region and city.

 

 What should you do?

A) Modify the connection string to add the packet size property and set its values to 8192. B) Add the following directive to the page: OutputCache VaryByParam=?
C) Add the following directive to the page: OutputCache VaryByControl=?region;city? D) Modify the connection string to keep your database's connection pool as small as possible.
 
Answer & Explanation Answer: B) Add the following directive to the page: OutputCache VaryByParam=?

Explanation:

You can vary user control output to the cache by specifying the user control name and the parameter. We use the VaryByParam attribute of the  OutputCache  

 

Incorrect Answers: 

 

A: The Packet Size property of the Connection string is the size in bytes of the network packets sed to communicate with an instance of data provider. It is not an optimal property to change to optimize data retrieval.

 

C: The company database does not seem to include a region column.

 

D: If we keep the connection pool small we would allow less simulation connections. However, this would not minimize the required to retrieve and display the data.

Report Error

View Answer Report Error Discuss

Q:

You create an ASP.NET application to provide corporate news and information to XYZ’s employees. The application is used by employees in New Zealand.


Default.aspx has a Web Form label control named currentDateLabel. The Page.Load event handler for Default.aspx included the following line of code:
currentDateLabel.Text = DateTime.Now.ToString(“D”)


You need to ensure that the data is displayed correctly for employees in New Zealand. What should you do?

A) In the Web.config file for the application, set the culture attribute of the globalization element to en-NZ. B) In the Web.config file for the application, set the uiCulture attribute of the globalization element to en-NZ.
C) In Visual Studio .NET, set the responseEncoding attribute in the page directive for Default.aspx to UTF-8. D) In Visual Studio .NET, save the Default.aspx page for both versions of the application by selecting Advanced Save Options from the File menu and selecting UTF-8.
 
Answer & Explanation Answer: A) In the Web.config file for the application, set the culture attribute of the globalization element to en-NZ.

Explanation:

The culture attribute of the globalization element specifies the default culture for processing incoming Web requests.

 

Incorrect Answers:

 

B: The uiculture attribute of the globalization specifies the default culture for processing locale dependent resource searches. It does not apply in this scenario.

 

C, D: The UTF8Encoding Class class encodes Unicode characters using UCS Transformation Format, 8-bit form (UTF-8). This encoding supports all Unicode character values and surrogates. However, it does not help in displaying data in New Zealand format.

Report Error

View Answer Report Error Discuss

Q:

You ASP.NET application manages order entry data by using a DataSet object named EXorderEntry. The EXorderEntry object includes two DataTable objects named orderNames and OrderDetails. A ForeignKeyConstraint object named orderDetailsKey is defined between the two DataTable objects.


You attempt to delete a row in orderNames while there are related rows in OrderDetails, and an exception is generated.What is the most likely cause of the problem?

A) The current value of OrderDetails.KeyDeleteRule is Rule.Cascade. B) The current value of OrderDetails.KeyDeleteRule is Rule.SetNull.
C) The current value of OrderDetails.KeyDeleteRule is Rule.SetDefault. D) The current value of OrderDetails.KeyDeleteRule is Rule.None.
 
Answer & Explanation Answer: D) The current value of OrderDetails.KeyDeleteRule is Rule.None.

Explanation:

The rule enumeration indicates the action that occurs when a ForeignKeyConstraint is enforced.None specifies that no action will occur, but exceptions are generated. This is what has occurred in this scenario.

 

Incorrect Answers:

 

A: Cascade specifies that all rows containing that value are also deleted.

B: SetNull specifies that values in all child columns are set to null values.

C: SetDefault specifies that all child columns be set to the default value for the column.

Report Error

View Answer Report Error Discuss

Q:

You are a Web developer for XYZ. You create an ASP.NET application that accesses sales and marketing data. The data is stored in a Microsoft SQL Server 2000 database on a server named XYZ01.


The company purchases a factory automation software application. The application is installed on XYZ01, where it creates a second instance of SQL Server 2000 named Factory and a database named FactoryDB. You connect to FactoryDB by using Windows Integrated authentication.


You want to add a page to your ASP.NET application to display inventory data from  FactoryDB. You use a SqlConnection object to connect to the database. You need to create a connection string to FactoryDB in the instance of SQL Server named Factory on XYZ01. Which string should you use?

A) ?Server=XYZ01;Data Source=Factory; Initial Catalog=FactoryDB;Integrated Security=SSPI? B) ?Server=XYZ01;Data Source=Factory; Database=FactoryDB;Integrated Security=SSP1?
C) ?Data Source=XYZ01\Factory; Initial Category=Factory; Integrated Security=SSP1? D) ?Data Source=XYZ01\Factory; Database=FactoryDB; Integrated Security=SSP1?
 
Answer & Explanation Answer: D) ?Data Source=XYZ01\Factory; Database=FactoryDB; Integrated Security=SSP1?

Explanation:

The Data Source attribute of the connection string contains the name, instance or network address of the instance of SQL Server to which to connect. In this scenario we are to connect to the Factory Instance on XYZ01 so we use XYZ01\Factory as data source. To specify the database we should either use the Database or the Initial Catalog attribute. Here we use Database=FactoryDB.

 

Incorrect Answers:

 

A, B: There is no Server attribute in the connection string. Instead we should use the Data Source attribute to specify the server and the instance.

 

C: There is no Initial Category attribute in the connection string. We can use Database or the Initial Catalog attribute to specify the database.

Report Error

View Answer Report Error Discuss

Q:

You are creating an ASP.NET page for a travel service. The page contains a CheckBoxList control that contains travel destinations. Customer can select favorite destinations to receive weekly e-mail updates of travel packages.

 

The CheckBoxList control is bound to a database table of possible destinations. Each destination is ranked according to its popularity. You modify the page to sort the destination list by rank, from the most popular to the least popular. The list has three columns.

 

You want the most popular destination to be on the top row of the check box list at run time. Which property setting should you use for the CheckBoxList control?

A) Set the RepeatDirection property to Vertical. B) Set the RepeatDirection property to Horizontal.
C) Set the RepeatLayout property to Flow. D) Set the RepeatLayout property to Table.
 
Answer & Explanation Answer: B) Set the RepeatDirection property to Horizontal.

Explanation:

The DataList.RepeatDirection property is used to get or select whether the DataList control displays vertically or horizontally. If this property is set to RepeatDirection.Horizontal, the items in the list are displayed in rows loaded from left to right, then top to bottom, until all items are rendered.

 

Incorrect Answers:

A: If the DataList.RepeatDirection property is set to RepeatDirection.Vertical, the items in the list are displayed in columns loaded from top to bottom, then left to right, until all items are rendered.


C, D:DataList.RepeatLayout Property gets or sets whether the control is displayed in a table or flow layout. It does not affect the order in which the items are displayed.

Report Error

View Answer Report Error Discuss

Q:

You develop an inventory management application called XYZManagement that will call a Microsoft SQL Server stored procedure named sp_GetDailyXYZSales. The stored procedure will run a query that returns your daily sales total as an output parameter. This total will be displayed to users in a message box.


Your application uses a SqlCommand object to run sp_GetDailyXYZSales. You write the
following code to call sp_GetDailyXYZSales:
SqlConnection cnn = new SqlConnection(myConnString);
SqlCommand cmd = new SqlCommand(“sp_GetDaily XYZ Sales”, cnn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = cmd.Parameters.Add(“@ItemTotal”,SqlDbType.Int);
prm.Direction = ParameterDirection.Output;
cnn.Open();
cmd.ExecuteNonQuery();


Now you must write additional code to access the output parameter. Which code segment should you use?

A) MessageBox.Show(?Total is: ? + cmd.Parameters[?@Output?].Value.ToString()); B) MessageBox.Show(?Total is: ? + cmd.Parameters[?@Output?].ToString());
C) MessageBox.Show(?Total is: ? + cmd.Parameters[?@ItemTotal? D) MessageBox.Show(?Total is: ? + cmd.Parameters[?@ItemTotal?
 
Answer & Explanation Answer: C) MessageBox.Show(?Total is: ? + cmd.Parameters[?@ItemTotal?

Explanation:

The @ItemTotal parameter is declared as an output parameter with SQL Server data type INT.We use the Value property of the SQLParameter class to retrieve the value of this parameter. We must also convert the INT value to a string value with the ToString method. We then supply this string to the MessageBox.Show method. 

 

Incorrect Answers


Option A, B:
The @ItemTotal parameter is the output parameter. Using @Output this way is incorrect. Output is a keyword and no variable named @Output has been declared.


Option D:
We must use the Value method to retrieve the value of the parameter..

Report Error

View Answer Report Error Discuss