PrepAway - Latest Free Exam Questions & Answers

Category: 70-568

Exam 70-568: UPGRADE: Transition your MCPD Enterprise Application Developer Skills to MCPD Enterprise Application Developer 3.5, Part 1

code segment should you use?

You are creating a Windows application by using the .NET Framework 3.5.You plan to
create a form that might result in a time-consuming operation. You use the
QueueUserWorkItem method and a Label control named lblResult.You need to update the
users by using the lblResult control when the process has completed the operation.Which
code segment should you use?

Which code segment should you use to ensure that the txtTN text box is validated?

You are creating aWindows Forms application for a courier company by using the .NET
Framework 3.5.You create a form that allows customers to track the progress of their
shipments. The form contains the following elements:
A text box named txtTN that allows users to enter a tracking number
An ErrorProvider control named ErrorProvider1 that informs users of an invalid
tracking number
A function named ValidTrackingNumber that validates tracking numbers

You need to ensure that the txtTN text box is validated. Which code segment should you use?

Which code segment should you insert at line 03?

You are creating a Windows application by using the .NET Framework 3.5.You create an
instance of the BackgroundWorker component named backgroundWorker1 To
asynchronously process time-consuming reports in the application.You write the following
code segment in the application. (Line numbers are included for reference only.)
01 private void backgroundWorker1_RunWorkerCompleted( object sender,
RunWorkerCompletedEventArgs e)
02 {
03?
04 }
You need to write a code segment that reports to the application when the background
process detects any of the following actions:
An exception is thrown.
The process is cancelled.
The process is successfully completed.
Which code segment should you insert at line 03?

should you use?

You are creating a Windows Forms application by using the .NET Framework 3.5. The
application requires a thread that accepts a single integer parameter.You write the following
code segment. (Line numbers are included for reference only.)
01 Thread myThread = new Thread(new
ParameterizedThreadStart(DoWork));
02 myThread.Start(100);
03 …
You need to declare the method signature of the DoWork method. Which method signature
should you use?

segment should you add at line 03?

You are creating a multiple-document interface (MDI) application by using the .NET
Framework 3.5.You configure the frmParent form to be an MDI parent.You write the
following code segment. (Line numbers are included for reference only.)
01 Form frmChild = new Form();
02 Form frmParent = this;
03
You need to associate and display the frmChild form and the frmParent form. Which code
segment should you add at line 03?

should you do?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5. The application contains two Web pages named OrderDetails.aspx and
OrderError.htm.If the application throws unhandled errors in the OrderDetails.aspx Web
page, a stack trace is displayed to remote users.You need to ensure that the OrderError.htm
Web page is displayed for unhandled errors only in the OrderDetails.aspx Web page. What
should you do?

Which line of code should you insert at line 07?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET. The application connects to a Microsoft SQL Server 2005 database.You write
the following code segment in the exception handler of the application. (Line numbers are
included for reference only.)
01 private string ShowSQLErrors(SqlException ex){
02 StringBuilder sb = new StringBuilder();
03 foreach (SqlError err in ex.Errors) {
04 sb.Append(“Message: “);
05 sb.Append(err.Number.ToString());
06 sb.Append(“, Level: “);
07
08 sb.Append(“, State: “);
09 sb.Append(err.State.ToString());
10 sb.Append(“, Source: “);
11 sb.AppendLine(err.Source.ToString());
12 sb.AppendLine(err.Message.ToString());
13 sb.AppendLine();
14 }
15 return sb.ToString();
16 }
You need to ensure that the original severity level of the error is included in the error
message for each SQL error that occurs.Which line of code should you insert at line 07?

What should you do?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET. The application connects to a Microsoft SQL Server 2005 database that contains
the tblOrderDetails table.You plan to create an exception handler for the application.The
tblOrderDetails table has been created by using the following DDL statement. CREATE
TABLE tblOrderDetails(
[OrderID] int NOT NULL FOREIGN KEY REFERENCES
tblCustomerOrders(OrderID),
[ProductID] int NOT NULL,
[Qty] int NOT NULL,
[UnitPrice] float CONSTRAINT ckPositivePrice CHECK (UnitPrice >=0),
[Discount] float CONSTRAINT ckPositiveDiscount CHECK (Discount >=0))
You need to ensure that the users are notified when an update to the tblOrderDetails table
causes a violation of any constraint. What should you do?

What should you do?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.The application connects to a Microsoft SQL Server 2005 database that contains
a table named Customers.Concurrent users update the Customers table frequently.You write
the following code segment. (Line numbers are included for reference only.)
01 SqlDataAdapter adapter = new SqlDataAdapter(
“SELECT CustomerID, CompanyName, LastUpdated” +
” FROM Customers ORDER BY CustomerID”, connection);
02 adapter.UpdateCommand = new SqlCommand(
“UPDATE Customers Set CompanyName = @CompanyName”
+ ” WHERE CustomerID = @CustomerID AND ” +
“LastUpdated = @LastUpdated”, connection);
03 adapter.UpdateCommand.Parameters.Add(
“@CustomerID”, SqlDbType.Int, 0, “CustomerID”);
04 adapter.UpdateCommand.Parameters.Add(
“@CompanyName”, SqlDbType.NVarChar, 30,
“CompanyName”);
05 SqlParameter parameter =
adapter.UpdateCommand.Parameters.Add(
“@LastUpdated”, SqlDbType.Timestamp, 0,
“LastUpdated”);
06 parameter.SourceVersion = DataRowVersion.Original;
07
You need to ensure that the application updates only records without optimistic concurrency
violations.What should you do?

Which line of code should you insert at line 09?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET. The application connects to a Microsoft SQL Server 2005 database. The
application populates a DataSet object by using a SqlDataAdapter object. You use the
DataSet object to update the Categories database table in the database.You write the
following code segment. (Line numbers are included for reference only.)
01 SqlDataAdapter dataAdpater = new SqlDataAdapter(“SELECT CategoryID,
CategoryName FROM Categories”, connection);
02 SqlCommandBuilder builder = new SqlCommandBuilder(dataAdpater);
03 DataSet ds = new DataSet();
04 dataAdpater.Fill(ds);
05 foreach (DataRow categoryRow in ds.Tables[0].Rows)
06 {
07 if (string.Compare(categoryRow[“CategoryName”].ToString(), searchValue, true) == 0)
08 {
09
10 }
11 }
12 dataAdpater.Update(ds);
You need to remove all the records from the Categories database table that match the value

of the searchValue variable.Which line of code should you insert at line 09?


Page 8 of 12« First...678910...Last »