Slide 1: PassGuide 70-553(VB)
Microsoft 70-553(VB)
UPGRADE:MCSD MS.NET Skills to MCPD Entpse App Dvlpr Pt1
Q&A
Demo
www.PassGuide.com
(C) Copyright 2006-2009 CertBible Tech LTD,All Rights Reserved.
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 2: PassGuide 70-553(VB)
Important Note Please Read Carefully
Study Tips This product will provide you questions and answers carefully compiled and written by our experts. Try to understand the concepts behind the questions instead of cramming the questions. Go through the entire document at least twice so that you make sure that you are not missing anything.
Latest Version We are constantly reviewing our products. New material is added and old material is revised. Free updates are available for 120 days after the purchase. You should check your member zone at PassGuide an update 3-4 days before the scheduled exam date.
Feedback If you spot a possible improvement then please let us know. We always interested in improving product quality. Feedback should be send to feedback@passguide.com. You should include the following: Exam number, version, page number, question number, and your login ID. Our experts will answer your mail promptly. Be Prepared. Be Confident. Get Certified. ------------------------------------------------------------------------------------------------------------------------Sales and Support Manager Sales Team: sales@passguide.com Support Team: support@passguide.com ---------------------------------------------------------------------------------------------------------------------
Copyright Each pdf file contains a unique serial number associated with your particular name and contact information for security purposes. So if we find out that a particular pdf file is being distributed by you, CertBible reserves the right to take legal action against you according to the International Copyright Laws.
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 3: PassGuide 70-553(VB)
1. You are developing an application that stores data about your company's sales and technical support teams. You need to ensure that the name and contact information for each person is available as a single collection when a user queries details about a specific team. You also need to ensure that the data collection guarantees type safety. Which code segment should you use? A. Dim team As Hashtable = New Hashtable() team.Add(1, "Hance") team.Add(2, "Jim") team.Add(3, "Hanif") team.Add(4, "Kerim") team.Add(5, "Alex") team.Add(6, "Mark") team.Add(7, "Roger") team.Add(8, "Tommy") B. Dim team As ArrayList = New ArrayList() team.Add("1, Hance") team.Add("2, Jim") team.Add("3, Hanif") team.Add("4, Kerim") team.Add("5, Alex") team.Add("6, Mark") team.Add("7, Roger") team.Add("8, Tommy") C. Dim team As New Dictionary(Of Integer, String) team.Add(1, "Hance") team.Add(2, "Jim") team.Add(3, "Hanif") team.Add(4, "Kerim") team.Add(5, "Alex") team.Add(6, "Mark") team.Add(7, "Roger") team.Add(8, "Tommy") D. Dim team As String() = New String() { _ "1, Hance", _ "2, Jim", _ "3, Hanif", _ "4, Kerim", _ "5, Alex", _ "6, Mark", _ "7, Roger", _ "8, Tommy"} Answer: C 2. You are creating a Windows Form. You add a TableLayoutPanel control named pnlLayout to the form. You set the properties of pnlLayout so that it will resize with the form. You need to create a three-column layout that has fixed left and right columns. The fixed columns must each remain 50 pixels wide when the form is resized. The middle column must fill the remainder of the form width when the form is resized. You add the three columns in the designer. Which code segment should you use to format the columns at run time? A.pnlLayout.ColumnStyles.Clear() pnlLayout.ColumnStyles.Add(New ColumnStyle(SizeType.Absolute, 50.0F)) pnlLayout.ColumnStyles.Add(New ColumnStyle(SizeType.AutoSize, 100.0F)) pnlLayout.ColumnStyles.Add(New ColumnStyle(SizeType.Absolute, 50.0F)) B.pnlLayout.ColumnStyles(0).Width = 50.0F pnlLayout.ColumnStyles(0).SizeType = SizeType.Absolute pnlLayout.ColumnStyles(2).Width = 50.0F pnlLayout.ColumnStyles(2).SizeType = SizeType.Absolute C.pnlLayout.ColumnStyles(0).Width = 50.0F pnlLayout.ColumnStyles(0).SizeType = SizeType.Absolute pnlLayout.ColumnStyles(1).Width = 100.0F pnlLayout.ColumnStyles(1).SizeType = SizeType.AutoSize pnlLayout.ColumnStyles(2).Width = 50.0F pnlLayout.ColumnStyles(2).SizeType = SizeType.Absolute
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 4: PassGuide 70-553(VB)
D.pnlLayout.ColumnStyles.Clear() pnlLayout.ColumnStyles.Add(New ColumnStyle(SizeType.Absolute, 50.0F)) pnlLayout.ColumnStyles.Add(New ColumnStyle(SizeType.Percent, 100.0F)) pnlLayout.ColumnStyles.Add(New ColumnStyle(SizeType.Absolute, 50.0F)) Answer: D 3. Your Web site uses custom Themes. Your Web site must support additional Themes based on the user's company name. The company name is set when a user logs on to the Web site. The company's Theme name is stored in a variable named ThemeName. You need to use this variable to dynamically set the Web site's Theme. What should you do? A. Add the following code segment to the markup source of each page on the Web site. <%@ Page Theme="ThemeName" ... %> B. Add the following code segment to the Load event of each page on the Web site. Page.Theme = ThemeName C. Add the following code segment to the PreInit event of each page on the Web site. Page.Theme = ThemeName D. Add the following code segment to the Web site's configuration file. <pages theme="ThemeName" /> Answer: C 4. You are creating a Windows Forms application. You add an ErrorProvider component named erpErrors and a DateTimePicker control named dtpStartDate to the application. The application also contains other controls. You need to configure the application to display an error notification icon next to dtpStartDate when the user enters a date that is greater than today's date. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. For the Validating event of dtpStartDate, create an event handler named VerifyStartDate. B. For the Validated event of dtpStartDate, create an event handler named VerifyStartDate. D. In the Properties Window for dtpStartDate, set the value of Error on erpErrors to Date out of range. C. In VerifyStartDate, call erpErrors.SetError(dtpStartDate, "Date out of range") if the value of dtpStartDate.Value is greater than today's date. D. In VerifyStartDate, call erpErrors.SetError(dtpStartDate, null) if the dtpStartDate.Value is greater than today's date. Answer: AD 5. You need to create a method to clear a Queue named q. Which code segment should you use? A. Dim e As Object For Each e In q q.Dequeue() Next
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 5: PassGuide 70-553(VB)
B. Dim e As Object For Each e In q q.Enqueue(Nothing) Next C. q.Clear() D. q.Dequeue() Answer: C 6.You are creating a Windows Form that includes a TextBox control named txtDate. When a user right-clicks within the text box, you want the application to display a MonthCalendar control. You need to implement a context menu that provides this functionality. What should you do? A. Add the following code to the form initialization. Dim cal As New MonthCalendar() Dim mnuContext As New ContextMenuStrip() Dim host As New ToolStripControlHost(mnuContext) txtDate.ContextMenuStrip = mnuContext B. Add the following code to the form initialization. Dim mnuContext As New ContextMenuStrip() Dim cal As New MonthCalendar() Dim host As New ToolStripControlHost(cal) mnuContext.Items.Add(host) txtDate.ContextMenuStrip = mnuContext C. Add the following code to the form initialization. Dim ctr As New ToolStripContainer() Dim cal As New MonthCalendar() ctr.ContentPanel.Controls.Add(cal) txtDate.Controls.Add(ctr) Add a MouseClick event handler for the TextBox control that contains the following code. If e.Button = MouseButtons.Right Then txtDate.Controls(0).Show() End If D. Add a MouseClick event handler for the TextBox control that contains the following code. If e.Button = MouseButtons.Right Then Dim mnuContext As New ContextMenuStrip() Dim cal As New MonthCalendar() Dim host As New ToolStripControlHost(cal) mnuContext.Items.Add(host) txtDate.ContextMenuStrip = mnuContext End If Answer: B 7. You are writing a custom dictionary. The custom-dictionary class is named MyDictionary. You need to ensure that the dictionary is type safe. Which code segment should you use? A. Class MyDictionary Implements Dictionary(Of String, String) B. Class MyDictionary Inherits HashTable C. Class MyDictionary Implements IDictionary
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 6: PassGuide 70-553(VB)
D. Class MyDictionary ... End Class Dim t As New Dictionary(Of String, String) Dim dict As MyDictionary = CType(t, MyDictionary) Answer: A 8. You are creating an undo buffer that stores data modifications. You need to ensure that the undo functionality undoes the most recent data modifications first. You also need to ensure that the undo buffer permits the storage of strings only. Which code segment should you use? A. Dim undoBuffer As New Stack(Of String) B. Dim undoBuffer As New Stack() C. Dim undoBuffer As New Queue(Of String) D. Dim undoBuffer As New Queue() Answer: A 9. You are creating a Windows Forms application. Initialization code loads a DataSet object named ds that includes a table named Users. The Users table includes a column named IsManager. You need to bind the IsManager column to the Checked property of a check box named chkIsManager. Which code segment should you use? A. chkIsManager.DataBindings.Add("Checked", ds, "Users.IsManager") B. chkIsManager.DataBindings.Add("Checked", ds, "IsManager") C. chkIsManager.Text = "{Users.IsManager}" chkIsManager.AutoCheck = True D. Me.DataBindings.Add("chkIsManager.Checked", ds, "Users.IsManager") Answer: A 10. A method in your Windows Forms application executes a stored procedure in a Microsoft SQL Server 2005 database, and then executes a second stored procedure in a second SQL Server 2005 database. You need to ensure that the call to the first stored procedure writes changes only if the call to the second stored procedure succeeds. Installation requirements prohibit you from introducing new components that use the COM+ hosting model. What should you do? A. Implement a transactional serviced component. Add methods to this component to encapsulate the connect operation and execution of each stored procedure. Register and use this serviced component.
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 7: PassGuide 70-553(VB)
B. Add a TransactionScope block. Connect to each database and execute each stored procedure within the TransactionScope block. Call the TransactionScope.Complete method if the call to both stored procedure succeeds. C. Connect to both databases. Call the SqlConnection.BeginTransaction method for each connection. Call the SqlTransaction.Commit method on both returned transactions only if both stored procedures succeed. D. Add a TryCatchFinally block. Connect to each database and execute each stored procedure in the try block. Answer: B 11. You are creating a Windows Forms application that includes the database helper methods UpdateOrder and UpdateAccount. Each method wraps code that connects to a Microsoft SQL Server 2005 database, executes a Transact-SQL statement, and then disconnects from the database. You must ensure that changes to the database that result from the UpdateAccount method are committed only if the UpdateOrder method succeeds. You need to execute the UpdateAccount method and the UpdateOrder method. Which code segment should you use? A. Using ts As New TransactionScope() UpdateOrder() UpdateAccount() ts.Complete() End Using B. Using ts1 As New TransactionScope() UpdateOrder() Using ts2 As New TransactionScope(TransactionScopeOption.RequiresNew) UpdateAccount() ts2.Complete() End Using ts1.Complete() End Using ts1.Complete(); C. Using ts1 As New TransactionScope() UpdateOrder() Using ts2 As New TransactionScope(TransactionScopeOption.RequiresNew) UpdateAccount() ts2.Complete() End Using ts1.Complete() End Using D. Using ts As New TransactionScope(TransactionScopeOption.RequiresNew) UpdateOrder() End Using Using ts As New TransactionScope(TransactionScopeOption.Required) UpdateAccount() ts.Complete() End Using Answer: A 12. You are creating a Windows Forms application. The application uses a SqlCommand object named cmd. The cmd object executes the following stored procedure. CREATE PROCEDURE GetPhoneList AS BEGIN
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 8: PassGuide 70-553(VB)
SELECT CompanyName, Phone FROM Customers SELECT CompanyName, Phone FROM Suppliers END You need to add all returned rows to the ListBox control named lstPhones. Which code segment should you use? A. Dim rdr As SqlDataReader = cmd.ExecuteReader() Do While rdr.Read() lstPhones.Items.Add((rdr.GetString(0) + ControlChars.Tab + rdr.GetString(1))) End While Loop While rdr.NextResult() B. Dim rdr As SqlDataReader = cmd.ExecuteReader() While rdr.Read() lstPhones.Items.Add((rdr.GetString(0) + ControlChars.Tab + rdr.GetString(1))) End While C. Dim rdr As SqlDataReader = cmd.ExecuteReader() While rdr.NextResult() While rdr.Read() lstPhones.Items.Add((rdr.GetString(0) + ControlChars.Tab + rdr.GetString(1))) End While End While D. Dim rdr As SqlDataReader = cmd.ExecuteReader() While rdr.NextResult() lstPhones.Items.Add((rdr.GetString(0) + ControlChars.Tab + rdr.GetString(1))) End While Answer: A 13. You have an SQL query that takes one minute to execute. You use the following code segment to execute the SQL query asynchronously. Dim ar As IAsyncResult = cmd.BeginExecuteReader() You need to execute a method named DoWork() that takes one second to run while the SQL query is executing. DoWork() must run as many times as possible while the SQL query is executing. Which code segment should you use? A. While ar.AsyncWaitHandle Is Nothing DoWork() End While dr = cmd.EndExecuteReader(ar) B. While Not ar.IsCompleted DoWork() End While dr = cmd.EndExecuteReader(ar) C. While Thread.CurrentThread.ThreadState = ThreadState.Running DoWork() End While dr = cmd.EndExecuteReader(ar)
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 9: PassGuide 70-553(VB)
D. While Not ar.AsyncWaitHandle.WaitOne() DoWork() End While dr = cmd.EndExecuteReader(ar) Answer: B 14. You are creating a Windows Forms application. The application loads a data table named dt from a database and modifies each value in the data table. You add the following code. (Line numbers are included for reference only.) 01 Dim row As DataRow 02 For Each row In dt.Rows 03 Dim col As DataColumn 04 For Each col In dt.Columns 05 06 Trace.WriteLine(str) 07 Next col 08 Next row You need to format the string named str to show the value of the column at the time the data is loaded and the current value in the column. Which code segment should you add at line 05? A. Dim str As String = String.Format("Column was {0} is now {1}", row(col), row(col, DataRowVersion.Current)) B. Dim str As String = String.Format("Column was {0} is now {1}", row(col, DataRowVersion.Default), row(col)) C. Dim str As String = String.Format("Column was {0} is now {1}", row(col), row(col, DataRowVersion.Proposed)) D. Dim str As String = String.Format("Column was {0} is now {1}", row(col, DataRowVersion.Original), row(col)) Answer: D 15. A Windows Forms application contains the following code segment. Dim SQL As String = "SELECT EmployeeID, LastName, FirstName FROM Employees" Dim da As New SqlDataAdapter(SQL, connStr) Dim dt As New DataTable() da.MissingSchemaAction = MissingSchemaAction.AddWithKey
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 10: PassGuide 70-553(VB)
Dim bld As New SqlCommandBuilder(da) da.Fill(dt) The application allows the user to add rows to the data table. The application will propagate these additions to the database. If the addition of any row fails, the other rows must still be added. The code must log how many new rows failed to be added. You need to propagate the additions to the database and log a failed count. Which code segment should you use? A. da.ContinueUpdateOnError = True da.Update(dt) Dim dtErrors As DataTable = dt.GetChanges(DataRowState.Unchanged) Trace.WriteLine((dtErrors.Rows.Count.ToString() + " rows not added.")) B. da.ContinueUpdateOnError = False da.Update(dt) Dim dtErrors As DataTable = dt.GetChanges(DataRowState.Unchanged) Trace.WriteLine((dtErrors.Rows.Count.ToString() + " rows not added.")) C. da.ContinueUpdateOnError = True da.Update(dt) Dim rows As DataRow() = dt.GetErrors() Trace.WriteLine((rows.Length.ToString() + " rows not added.")) D. da.ContinueUpdateOnError = False da.Update(dt) Dim rows As DataRow() = dt.GetErrors() Trace.WriteLine((rows.Length.ToString() + " rows not added.")) Answer: C 16. A Windows Forms application contains the following code segment. Dim SQL As String = "SELECT OrderID, ProductID, UnitPrice, Quantity FROM [Order Details]" Dim da As New SqlDataAdapter(SQL, connStr) Dim dt As New DataTable() da.Fill(dt) You need to add a new column to the data table named ItemSubtotal. The ItemSubtotal column must contain the value of the UnitPrice column multiplied by the value of the Quantity column. Which code segment should you use? A. Dim col As New DataColumn("ItemSubtotal") col.DataType = GetType(Decimal) col.Expression = "UnitPrice * Quantity" dt.Columns.Add(col) B. dt.Compute("UnitPrice * Quantity", "ItemSubtotal") C. Dim col As New DataColumn("ItemSubtotal") col.DataType = GetType(Decimal) dt.Columns.Add(col) dt.Compute("UnitPrice * Quantity", "ItemSubtotal")
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 11: PassGuide 70-553(VB)
D. Dim col As New DataColumn("ItemSubtotal") col.DataType = GetType(Decimal) col.DefaultValue = "UnitPrice * Quantity" dt.Columns.Add(col) Answer: A 17.A Windows Forms application reads the following XML file. <?xml version="1.0"?> <x:catalog xmlns:x="urn:books"> <book id="bk101"> <author>Gambardella, Matthew</author> <title>XML Developer's Guide</title> </book> <book id="bk102">
<author>Ralls, Kim</author> <title>Midnight Rain</title> </book> </x:catalog> The form initialization loads this file into an XmlDocument object named docBooks. You need to populate a ListBox control named lstBooks with the concatenated book ID and title of each book. Which code segment should you use? A. Dim elements As XmlNodeList = docBooks.GetElementsByTagName("book") Dim node As XmlElement For Each node In elements Dim s As String = node.GetAttribute("id") + " - " s = s + node.SelectSingleNode("title").InnerText lstBooks.Items.Add(s) Next node B. Dim elements As XmlNodeList = docBooks.GetElementsByTagName("book") Dim node As XmlElement For Each node In elements Dim s As String = node.SelectSingleNode("id").ToString() + " - " s = s +
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 12: PassGuide 70-553(VB)
node.GetAttribute("title") lstBooks.Items.Add(s) Next node C. Dim elements As XmlNodeList = docBooks.GetElementsByTagName("book") Dim node As XmlElement For Each node In elements Dim s As String = node.GetAttribute("id") + " - " s = s + node.SelectSingleNode("title").Value lstBooks.Items.Add(s) Next node D. Dim elements As XmlNodeList = docBooks.GetElementsByTagName("book") Dim node As XmlElement For Each node In elements lstBooks.Items.Add(node.InnerXml) Next node Answer: A 18. You create the following Web user control named ErrorMessages. <%@ Control Language="VB" AutoEventWireup="false" CodeFile="ErrorMessages.ascx.vb" Inherits="ErrorMessages" %> <script> Protected m_Text As String = "This is a default message!" Public Property Text() As String Get Return m_Text End Get Set(ByVal value As String) m_Text = value End Set End Property </script> The ErrorMessages control uses a public property that displays the error message. You need to change the default error message property on the Web Form in which the control is implemented. Which code segment should you use? A. <fabrikam:Message id="MyMessage" MyMessage-Text="This is a custom message!" runat="server"/> B. <fabrikam:Message id="MyMessage" MessageText="This is a custom message!" runat="server"/> C. <fabrikam:Message id="MyMessage" Text="This is a custom message!" runat="server"/> D. <fabrikam:Message id="MyMessage" Message_Text="This is a custom message!" runat="server"/> Answer: C 19. You need to write a code segment that will add a string named strConn to the connection
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 13: PassGuide 70-553(VB)
string section of the application configuration file. Which code segment should you use? A. Dim myConfig As Configuration = _ ?ConfigurationManager.OpenExeConfiguration( _ ?ConfigurationUserLevel.None) myConfig.ConnectionStrings.ConnectionStrings.Add( _ ?New ConnectionStringSettings("ConnStr1", strConn)) myConfig.Save() B. Dim myConfig As Configuration = _ ConfigurationManager.OpenExeConfiguration( _ ?ConfigurationUserLevel.None) myConfig.ConnectionStrings.ConnectionStrings.Add( _ ?New ConnectionStringSettings("ConnStr1", strConn)) ConfigurationManager.RefreshSection("ConnectionStrings") C. ConfigurationManager.ConnectionStrings.Add( _ New ConnectionStringSettings("ConnStr1", strConn)) ConfigurationManager.RefreshSection("ConnectionStrings") D. ConfigurationManager.ConnectionStrings.Add( ?New ConnectionStringSettings("ConnStr1", strConn)) Dim myConfig As Configuration = _ ?ConfigurationManager.OpenExeConfiguration( _ ?ConfigurationUserLevel.None) myConfig.Save() Answer: A 20. You are using the Microsoft Visual Studio 2005 IDE to examine the output of a method that returns a string. You assign the output of the method to a string variable named fName. You need to write a code segment that prints the following on a single line The message: "Test Failed: " The value of fName if the value of fName does not equal "John" You also need to ensure that the code segment simultaneously facilitates uninterrupted execution of the application. Which code segment should you use? A. Debug.Assert(fName = "John", "Test Failed: ", fName) B. Debug.WriteLineIf(fName <> "John", _ ?fName, "Test Failed") C. If fName <> "John" Then Debug.Print("Test Failed: ") Debug.Print(fName) End If D. If fName <> "John" Then Debug.WriteLine("Test Failed: ") Debug.WriteLine(fName) End If
PassGuide.com - Make You Succeed To Pass IT Exams
Slide 14: PassGuide 70-553(VB)
Answer: B
PassGuide.com - Make You Succeed To Pass IT Exams