Free Cheat-test Samples and Demo Questions Download
Adobe exams Adobe
Apple exams Apple
Avaya exams Avaya
Check Point exams Check Point
Cisco exams Cisco
Citrix exams Citrix
CIW exams CIW
CompTIA exams CompTIA
CWNP exams CWNP
EC-Council exams EC-Council
EMC exams EMC
Exin exams Exin
Fortinet exams Fortinet
GIAC exams GIAC
Hitachi exams Hitachi
HP exams HP
IBM exams IBM
Isaca exams Isaca
ISC exams ISC
ISEB exams ISEB
Juniper exams Juniper
LPI exams LPI
McAfee exams McAfee
Microsoft exams Microsoft
Oracle exams Oracle
PMI exams PMI
Riverbed exams Riverbed
SNIA exams SAP
Sun exams SAS
Symantec exams Symantec
VMware exams VMware
All certification exams

Microsoft 70-526(VB) Exam - Cheat-Test.com

Free 70-526(VB) Sample Questions:

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

2. 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.
C. In the Properties Window for dtpStartDate, set the value of Error on erpErrors to Date out of range.
D. In VerifyStartDate, call erpErrors.SetError(dtpStartDate, "Date out of range") if the value of dtpStartDate.Value is greater than today's date.
E. In VerifyStartDate, call erpErrors.SetError(dtpStartDate, null) if the dtpStartDate.Value is greater than today's date.
Answer: AD

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

4. You are customizing a Windows Form. When the user clicks any button, you want the application to log information about the user’s actions by calling a method with the following signature.
Public Sub ctl_Click(ByVal sender As Object, ByVal e As EventArgs)
You want the form to invoke this method when any Button control is clicked and only when a Button control is clicked.
You need to modify the form to invoke this method without interfering with the existing operations of the application.
What should you do?
A. Add the following code to the form initialization.
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is Button Then
AddHandler ctl.Click, AddressOf ctl_Click
End If
Next ctl
B. Add the following code to the form initialization.
AddHandler Me.Click, AddressOf ctl_Click
C. Use the Properties dialog box to set the Click event for each Button control on the form to the ctl_Click method.
D. Use the Properties dialog box to set the Click event of the form to the ctl_Click method.
Answer: A

5. You are customizing a Windows Form. The form includes a menu that has several ToolStripMenuItem controls. An event handler is configured to handle the Click event for all ToolStripMenuItem controls. The event handler has the following signature.
Private Sub mnu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
The form class includes a method that has the following signature.
Private Sub LogClick(ByVal ctlName As String)
You need to add code so that when a user clicks a ToolStripMenuItem control, the mnu_Click method calls the LogClick method. The LogClick method must be called with the ctlName parameter set to the menu text in the ToolStripMenuItem control.
Which code segment should you use?
A. Dim mnuItem As ToolStripMenuItem = CType(sender, ToolStripMenuItem)
LogClick(mnuItem.Text)
B. LogClick(e.ToString())
C. LogClick(Me.Text)
D. Dim mnuItem As ToolStripMenuItem =
CType(Me.GetContainerControl(), ToolStripMenuItem)
LogClick(mnuItem.Text)
Answer: A

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

7. 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.
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 Try…Catch…Finally block.
Connect to each database and execute each stored procedure in the try block.
Answer: B

8. 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
9. 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
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

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


© 2014 Cheat-Test.com, All Rights Reserved