Exam 70-526 preparation questions

Page 1

Exam 70-526 study material Made available by Testkingprep.com

Free 70-526 Exam Preparation Questions Exam 70-526: TS: Microsoft .NET Framework 2.0 - Windows-Based Client Development

For Latest 70-526 Exam Questions and study guides- visit- http://www.testkingprep.com/70-526.html


Question:1 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 E. dtpStartDate->Value is greater than today's date. F. In VerifyStartDate, call erpErrors->SetError(dtpStartDate, "") if the value of dtpStartDate->Value is greater than today's date. Answer: A, E Question:2 You are creating a custom control that displays an image in the background. You notice that when the control is resized, the background image flickers while the control is repeatedly repainted. You nee to eliminate the background image flicker. Which three code segments should you use? (Each correct answer presents part of the solution. Choose three.) A. this->SetStyle(ControlStyles::OptimizedDoubleBuffer, true); B. this->SetStyle(ControlStyles::AllPaintingInWmPaint, true); C. this->SetStyle(ControlStyles::UserPaint, true); D. this->SetStyle(ControlStyles::ResizeRedraw, true); E. this->SetStyle(ControlStyles::Opaque, true); Answer: A, C, D Question:3 You are creating a custom Windows Forms control. On the background of the control, an ellipse completely filled with a colored gradient is drawn. The bounds for the ellipse are equal to the bounds for the control. The control must correctly repaint itself in all situations. You need to include the drawing of the ellipse in the OnPaint event handler for the custom control. Which code segment should you use? A. Brush ^linearGradientBrush = gcnew LinearGradientBrush(e->ClipRectangle, startGradient, endGradient, 45); e->Graphics->FillEllipse(linearGradientBrush, e->ClipRectangle); B. Brush ^linearGradientBrush = gcnew LinearGradientBrush( Point(this->Left, this->Top), Point(this->Right, this->Bottom), startGradient, endGradient); e->Graphics>FillEllipse(linearGradientBrush, e->ClipRectangle); C. Brush ^linearGradientBrush = gcnew LinearGradientBrush( Rectangle(this->Left, this->Top, this>Width, this->Height), startGradient, endGradient, 45, true); e->Graphics>FillEllipse(linearGradientBrush, this->Left, this->Top, this->Width, this->Height); D. Brush ^linearGradientBrush = gcnew LinearGradientBrush(this->ClientRectangle, startGradient, endGradient, 45); e->Graphics->FillEllipse(linearGradientBrush, this>ClientRectangle); Answer: D Question:4 You are creating a Windows Forms application that prints reports. The application uses the PrintDocument control to print the report and the PrintPreviewDialog control to preview reports as shown in the following code segment. streamToPrint = gcnew StreamReader("..\\..\\FileToPrint.txt"); try { PrintDocument ^pd = gcnew PrintDocument(); pd->PrintPage += gcnew PrintPageEventHandler(this, &Form1::pd_PrintPage); PrintPreviewDialog ^ppd = gcnew PrintPreviewDialog(); ppd->Document = pd; ppd->ShowDialog(); } finally { streamToPrint->Close(); } When a report is printed by using the Print method on the PrintDocument class, the output is correct.

For Latest 70-526 Exam Questions and study guides- visit- http://www.testkingprep.com/70-526.html


When the report is previewed by using the Print Preview dialog box, the output is correct. However, when the report is printed by using the Print button in the Print Preview dialog box, a single blank page is produced. You need to ensure that the output is correct when the Print button in the Print Preview dialog box is used. What should you do? A. In the event handler for the ppd_Click event, set the position of the streamToPrint>BaseStream property to 0. B. In the event handler for the ppd_PrintPreviewControl_Click event, set the position of the streamToPrint->BaseStream property to 0. C. In the event handler for the pd_PrintPage event, set the position of the streamToPrint>BaseStream property to 0. D. In the event handler for the pd_BeginPrint event, set the position of the streamToPrint>BaseStream property to 0. Answer: D Question:5 A Windows Forms application includes resources that are localized for several languages. You want to view your application when it uses resources that are localized for the French language as spoken in France. This culture is denoted by the culture name fr-FR. You need to test the application by using the resources contained in the satellite assembly. You must not modify the regional settings of your computer. What should you do? A. Set the following assembly attribute.[assembly: NeutralResourcesLanguage("fr-FR")]; B. Add the following code to the application initialization.RegionInfo^ ri = gcnew RegionInfo("FR"); C. Thread::CurrentThread->Name = ri->NativeName; D. Add the following code to the application initialization.Thread::CurrentThread>CurrentUICulture = gcnew CultureInfo("fr-FR"); E. Add the following code to the applicationSettings section of the application configuration file.<setting name="CultureInfo" serializeAs="String"> <value>"fr-FR"</value></setting> Answer: C Question:6 Which of the following code snippets demonstrates how to add a new instance of a Windows Form named Form1 at run time? A. ' VB Dim myForm As Form1 CreateForm() // C# Form1 myForm; CreateForm(); B. ' VB Dim myForm As Form1 Show() // C# Form1 myForm; Show(); C. ' VB myForm = Form1 Show() // C# myForm = Form1; Show(); D. ' VB Dim myForm As Form1 myForm = New Form1() // C# Form1 myForm; myForm = new Form1(); Answer: D Question:7 As the member of a team, you are developing some codes below:string query = @"SELECT EmployeeID, LastName, FirstName FROM Employees";SqlDataAdapter daAdapter = new SqlDataAdapter(query, conn);DataTable dataTest = new DataTable();daAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;SqlCommandBuilder sqlBuild = new SqlCommandBuilder(daAdapter);daAdapter.Fill (dataTest);You should increase the log to rember the requirements below:1. The system should permit the user to increase the information of rows to the datatable.2. The system will double some conditions to the current database.3. The rows could not fail when some of the row is worng.In order to solve the problem, which is the correct answer? A. dataTest.ContinueUpdateOnError = true; Update(dataTest); GetALLErrors(); WriteLine (rows.Length.ToString() + " rows not added."); B. dataTest.ContinueUpdateOnError = true; Update(dataTest); GetChanges(DataRowState.changed); WriteLine(dtErrors.Rows.Count.ToString() + " rows not added."); C. dataTest.ContinueUpdateOnError = true; Update(dataTest); GetErrors(); WriteLine

For Latest 70-526 Exam Questions and study guides- visit- http://www.testkingprep.com/70-526.html


(rows.Length.ToString() + " rows not added."); D. dataTest.ContinueUpdateOnError = true; Update(dataTest); WriteLine(rows.Length.ToString() + " rows not added.");

GetLastErrors();

Answer: C Question:8 Which of the following are required to associate and enable a context menu strip named ContextMenu1 with a button named Button1? A. The ContextMenuStrip property for Button1 must be set to ContextMenu1. B. The ShowPopUp property for Button1 must be set to True. C. Button1 must call the ContextMenu1.ShowPopUp method in its RightClick event handler. D. The ContextMenu1.Control property must be set to Button1. Answer: A Question:9 Legend is a custom, owner-drawn control which accessibility functionality is being added in. AccessibleLegend is a class, which comes from the class named AccessibleObject. The GetChild method is overridden by the Legend control with an AccessibleLegend object returned. You should make sure that when we disabled theLegend control, the State property's value of the AccessibleLegend object is still returned correctly by the control. Which State property's value should you set to return? A. AccessibleStates.Protected B. AccessibleStates.ReadOnly C. AccessibleStates.Invisible D. AccessibleStates.Unavailable Answer: D Question:10 Resources which support several languages are included in a Windows Forms application. When your application utilizes resources which support the French language as spoken in France, you want to view it. The culture name fr-FR denotes this culture. You should use the resources included in the satellite assembly to test the application. The regional settings of your computer must not be modified. What should you do? A. Attribute.assembly should be set to NeutralResourcesLanguage("fr-FR") B. The following code should be added to the application: initialization.RegionInfo ri = new RegionInfo("FR");Thread.CurrentThread.Name = ri.NativeName; C. The following code should be added to the application initialization.Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR"); D. Add <setting name="CultureInfo" serializeAs="String"> <value>"fr-FR"</value></setting>to the applicationSettings section of the application configuration Answer: C Question:11 Which of the following properties of an instance e of the KeyEventArgs class can be used in a KeyDown event handler to determine if the Ctrl key has been pressed? (Choose all that apply.) A. e.Control B. e.KeyCode C. e.KeyData D. e.Modifiers Answer: A, B, C, D Question:12 A multiple-document interface (MDI) Windows Forms application is being created. The main form should be set to function as the parent form and a second form should be set to function as the child form. What should you do?

For Latest 70-526 Exam Questions and study guides- visit- http://www.testkingprep.com/70-526.html


A. The IsMdiContainer property of the parent form should be set to True. The child form??s MdiParent property should be set to the parent form. B. The IsMdiContainer property of the parent form should be set to True. The child form's Parent property should be set to the parent form. C. The child form should be added to the parent form's Controls collection. The child form's MdiParent property should be set to the parent form. D. The child form should be added to the parent form's Controls collection. The child form's Parent property should be set to the parent form. Answer: A Question:13 A custom Windows Forms control which includes Width, Height, and SquareFootage properties is being created. The multiplied value of Width and Height is contained in the SquareFootage property. SquareFootage should be made visible, when we disabe it in the property grid. What should you do? A. The NotSerialized() attribute should be applied to the SquareFootage property. B. The DesignerSerializationVisibility() attribute should be applied to the SquareFootage property, and transfer a parameter the value of C. Content. D. The EditorBrowsable attribute should be applied to the SquareFootage property, tranferring a parameter the value of EditorBrowsableState.Never. E. Utilize only a Get accessor to implement the property. Answer: D Question:14 Which of the following code examples will add a new event handler named ClickHandler to the Button1.Click event at run time? A. ' VB Click.AddHandler(ClickHandler) // C# Click; B. ' VB Click, ClickHandler) // C# Click, ClickHandler); C. ' VB Click, AddressOf ClickHandler // C# Click += ClickHandler; D. ' VB Click += AddressOf ClickHandler // C# Click ++ ClickHandler; Answer: C Question:15 A custom control is created by extending a standard TextBox control. ValidationColor is a new property added in the custom control. You should make sure that users are able to utilize the color selection palette which is available for other standard Windows Forms controls to select the color for the ValidationColor property from the Properties window at design time. Which is the correct answer? A. A custom context menu which includes the chosen color palette and logic.Implement the IContainerControl interface for your control should be created. B. A custom dialog box which includes the chosen color palette and logic.Configure the FormBorder property of the dialog box to None.Implement the C. A custom dialog box which includes the chosen color palette and logic.Configure the FormBorder property of the dialog box to None should be created. Write D. The type of the property should be declared as System.Drawing.Color. Answer: D Question:16 A Windows Form is being customized. DialerControl is a composite control which You want to display a custom icon on in the toolbox. The toolbox icon should be customized. You want to utilize the minimum amount of effort to finish it. Which is the correct answer? (Select more than one) A. A bitmap named DialerControl.bmp should be added to the user control project. B. The build action of the bitmap should be changed to Embedded Resource. C. A ToolboxBitmap attribute should be added to the DialerControl class, transferring the parameter DialerControl.bmp. D. A ToolboxBitmap attribute should be added to the DialerControl class, transferring the

For Latest 70-526 Exam Questions and study guides- visit- http://www.testkingprep.com/70-526.html


parameter typeof(DialerControl). Answer: A, B Question:17 Where is the connection object located that was created as a result of running the Data Source Configuration Wizard? A. In the application configuration file B. In the Data Sources window C. In the designer-generated dataset code file D. In the generated form code Answer: C Question:18 Which of the following code samples demonstrates the correct way to add a But-ton control to a form named Form1 at run time? A. ' VB Controls.Add(Button) // C# Controls.Add(Button); B. ' VB Dim aButton As New Button Controls.Add(aButton) // C# Button aButton = new Button(); Controls.Add(aButton); C. ' VB Dim aButton As New Button Add(aButton) // C# Button aButton = new Button(); Add(aButton); D. ' VB Add(New Button) Answer: B Question:19 A Windows Forms application is being created. A custom control is used in Your application. Some extra properties are added to the control which is based on a standardWindows Forms Button control. Some of these properties are read-only. You should make sure that in the Properties window of the design environment, it does not display the read-only properties. Which is the correct answer? A. You should utilize the EditorBrowsable attribute to decorate the read-only properties, and then the EditorBrowsable attribute should be set to Never. B. You should utilize the DesignTimeVisible attribute, and then the DesignTimeVisible attribute should be set to False. C. You should utilize the Browsable attribute to decorate the read-only properties, and then the Browsable attribute should be set to False. D. You should utilize the DisplayName attribute to decorate the read-only properties, and then the DisplayName attribute should be set to null. Answer: C Question:20 A dataset's schema is being created by a Windows Forms application programmatically. Departments is a data table included in the dataset. DepartmentID and DepartmentName are columns in the table. You should make sure that while we add a new row, a unique integer value is assigned to the DepartmentID column in the Departments table. Which is the correct answer? A. The DepartmentID column's Expression property should be set to "DepartmentID + 2". B. A Unique constraint should be added for the DepartmentID column. C. The DepartmentID column's AutoIncrement property should be set to True. D. The DepartmentID column should be set as the primary key. Answer: C Question:21 When should you use the OleDbConnection object? (Choose all that apply.)

For Latest 70-526 Exam Questions and study guides- visit- http://www.testkingprep.com/70-526.html


A. When connecting to an Oracle database B. When connecting to an Office Access database C. When connecting to SQL Server 6.x. D. When connecting to SQL Server 2000 Answer: B, C Question:22 As a member of program group at Company. com, you are developing Windows Forms application.There is one method which calls a stored procedure in a Microsoft SQL Server 2005 database and calls a second stored procedure in the same database.In order to keep the data intergitery You could use the COM+ hosting model. Which is the correct answer? A. You should run a transactional serviced component at the same time when you are running both stored procedure B. You should increase a TransactionScope block.you link to every database and run every stored procedure within the TransactionScope block.and then invoke the Complete method if the call to both stored procedure succeeds. C. You should increase a TransactionScope block.you link to every database and run every stored procedure within the TransactionScope block. D. You should add the block of try-catch-finally and connect to every database and run every stored procedure in the try block. Answer: B Question:23 The exsited information is listed in your application below:There is a DataSet called Ds in your application.There is a table name UsersTable in your application.There is a column named UserColum in your application.You should bind the UserColum column to a check box named chkTest. Which is the correct answer? A. ChkTest.DataBindings.Add("Checked", Ds, " UsersTable. UserColum"); B. ChkTest.DataBindings.Add("Checked", Ds, " Ds.UsersTable. UserColum"); C. ChkTest.Text = "{Users. chkIsManager }";chkIsManager.AutoCheck = False; D. This.DataBindings.Add("chkTest.Checked", Ds, " Ds.Users.chkIsManager "); Answer: A Question:24 As a member of program group at Company. com, you are developing a Windows Forms application which shows information form a Microsoft SQL Server 2008 database in a DataGridView control that is populated by a data table. You could utilize a SqlDataAdapter object to fill the data table. In order to show changes to the database, which is the correct answer? A. You should develop a SqlDependency object and bin it to a SqlCommand object which is utilized through the SqlDataAdapter object.and then reload the dataset B. When invoking the Fill method of the SqlDataAdapter object.you should utilize a TransactionScope block C. You should configure the attribute of CommandTimeout and make it 0. D. When invoking the Fill method of the SqlDataAdapter object.you should utilize a Try-Catch block. Answer: A

For Latest 70-526 Exam Questions and study guides- visit- http://www.testkingprep.com/70-526.html


For complete Exam 70-526 Training kits and Self-Paced Study Material Visit: http://www.testkingprep.com/70-526.html

http://www.testkingprep.com/

For Latest 70-526 Exam Questions and study guides- visit- http://www.testkingprep.com/70-526.html


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.