[ Pobierz całość w formacie PDF ]
control on your page to display the list of unshipped orders.
You want to display the YTD sales in a Label control named ytdLabel.
Which code segment should you use?
A. reader.NextResult();
ytdLabel.Text = cmd.Parameters[ @YTD ].Value.ToString();
reader.Close();
B. reader.Close();
ytdLabel.Text = reader.NextResult().ToString();
C. reader.Close();
ytdLabel.Text = cmd.Parameters[ @YTD ].Value.ToString();
D. ytdLabel.Text =
cmd.Parameters[ @RETURN_VALUE ].Value.ToString();
reader.Close();
Answer: C
QUESTION NO: 62
You develop a Windows-based application that enables users to update customer contact
information. Your application uses a DataSet object to maintain the customer data while users
are reviewing and editing it. When a user finishes updating the data, your application uses the
DataSet.WriteXml method to create an XML data file.
The tag name of the root element of the XML data file must be . You need to
add code to your application to ensure that this tag name is set correctly.
Which code segment should you use?
A. dsCustomer.Namespace = TestKingInfo ;
B. dsCustomer = new DataSet( TestKingInfo );
C. dsCustomer.Prefix = TestKingInfo ;
D. dsCustomer.WriteXml( TestKingInfo );
Answer: B
QUESTION NO: 63
You develop a Windows-based order entry application. The application uses a DataSet object
named customerDataSet to manage client data while users edit and update customer records.
www.correctexams.com
- 37 -
Fast Way to get your Certification
The DataSet object contains a DataTable object named creditAuthorizationDataTable. This
object contains a field named MaxCredit, which specifies the credit limit for each customer.
Customer credit limits cannot exceed $20,000. Therefore, your application must verify that
users do not enter a larger amount in MaxCredit. If a user does so, the user must be notified,
and the error must be corrected, before any changes are stored permanently in the database.
You create a procedure named OnRowChanged. This procedure sets the
DataTable.Row.RowError property for each row that includes an incorrect credit limit. You
also enable the appropriate event handling so OnRowChanged is called in reaction to the
RowChanged OnRowChanged contains the following code segment:
private void OnRowChanged(
Object sender, DataRowChangeEventArgs e) {
if ((double) e.Row[ MaxCredit ] > 20000) {
e.Row.RowError = Over credit limit. ;
}
}
Before updating the database, your application must identify and correct all rows that are
marked as having an error.
Which code segment should you use?
A. foreach (DataRow myRow in
creditAuthorizationDataTable.GetErrors()) { MessageBox.Show(
String.Format( CustID = {0}, Error = {1} , myRow[ CustID ],
myRow.RowError)); }
B. foreach (DataRow myRow in
CreditAuthorizationDataTable.HasErrors() { MessageBox.Show (
String.Format( CustID = {0}, Error = {1} , myRow[ CustID ],
myRow.RowError)); }
C. DataView vw = new DataView(
customerDataSet.Tables[ creditAuthorizationDataTable ],
DataViewRowState.ModifiedCurrent); MessageBox.Show(
String.Format( CustID = {0} Error , vw( CustID )));
D. DataView vw = new DataView(
customerDataSet.Tables[ creditAuthorizationDataTable ],
DataViewRowState.ModifiedOriginal); MessageBox.Show(
String.Format( CustID = {0} Error , vw( CustID )));
Answer: A
QUESTION NO: 64
You develop a Windows-based application to manage inventory. The application calls a
Microsoft SQL Server stored procedure named sp_UpdatePrices.
sp_UpdatePrices performs a SQL UPDATE statement that increases prices for selected items
in an inventory table. It returns an output parameter named @totalprice and a result set that
www.correctexams.com
- 38 -
Fast Way to get your Certification
Fast Way to get your Certification
Fast Way to get your Certification
contains all of the records that were updates. @totalprice contains the sum of the prices of all
items that were updates.
You implement a SqlCommand object that executes sp_UpdatePrices and returns the results to
a SqlDataReader object. The SqlDataReader object gives you access to the data in the result
set, which is displayed in a list box on your Windows Form.
The value of @total price must also be displayed in a text box on your Windows Form. You
need to write code that will retrieve this value.
Which code segment should you use?
A. while (reader.Read() { TextBox1.Text =
com.Parameters[ @totalprice ].Value.ToString(); }
reader.Close();
B. do { TextBox1.Text =
com.Parameters[ @totalprice ].Value.ToString(); } while
(reader.Read()); reader.Close();
C. TextBox1.Text =
com.Parameters[ @totalprice ].Value.ToString();
reader.Close();
D. reader.Close(); TextBox1.Text =
com.Parameters[ @totalprice ].Value.ToString();
Answer: D
QUESTION NO: 65
You plan to use Visual Studio .NET to create a class named BusinessRules, which will be used
by all applications in your company. BusinessRules defines business rules and performs
calculations based on those rules. Other developers at TestKing must not be able to override
the functions and subroutines defined in BusinessRules with their own definitions.
Which two actions should you take to create BusinessRules? (Each correct answer presents
part of the solution. Choose two)
A. Create a Windows control library project.
B. Create a class library project.
C. Create a Windows Service project.
D. Use the following code segment to define BusinessRules:
protected class BusinessRules
E. Use the following code segment to define BusinessRules:
public new class BusinessRules
F. Use the following code segment to define BusinessRules:
public sealed class BusinessRules
G. Use the following code segment to define BusinessRules:
public abstract BusinessRules
Answer: B, F
www.correctexams.com
www.correctexams.com
www.correctexams.com
- 39 -
Fast Way to get your Certification
QUESTION NO: 66
Your development team at TestKing is creating a new Windows-based application for a
mortgage 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 the XML Web service by using the Wsdl.exe.
C. Obtain a copy of the XML Web service assembly and register it on your local development
computer.
[ Pobierz całość w formacie PDF ]