You are on page 1of 59

1.___________________property of the OpenFileDialog class opens the selected file with read-only permissions.

Filter Title OpenFile FileOk 2. Which of the following are the advantages of using MDI application? 1. Systematic Organization 2. Increased Efficiency 3. Less Memory Usage 4. Easy Implementation

1, 2, 3 2, 3, 4 1, 3, 4 1, 2, 3, 4 3. An object of the _______ class cannot be created. MenuStrip Menu ContextMenuStrip 4. The ___________ property of the StatusStrip class specifies or retrieves a value that indicates whether the StatusStrip contains a handle in its lower right corner. CanOverflow

SizingGrip GripStyle 5. The ____________ property of the Command object retrieves the text of a command statement to be used against a data provider. Connection CommandText Conmmand Type 6. The _______ method of the DataAdapter class adds a DataTable in a DataSet. FillSchema() FillLoadOption RefillSchema() 7. The _____________ method of the DataAdapter class executes a set of executable commands. IsNull() // cau nay sai RunLoad() ExecuteBatch () //cau6 dung 8. The _________ method of the DataTable class copies a DataRow into a DataTable. SetOrdinal() ImportRow GetFieldType() 9. The _____________ method of the DataTableReader class gets the data type of a particular column.

// chinh sat la kieu object FillSchema() ExecuteBatch() GetFieldType() 10. The two-way data binding binds a property to a field in a _____________ manner. read/write Write-only Read-only 11. No public constructors are defined in the _________ class. DataGridViewColumn DataGridViewBand DataGridViewRow 12. The ________ class allows the user to bind a property of the specified control with the property of an object. BindStyle BindingSource Binding 13. In the case of re-installing __________ technology based applications, only the modified parts of the application are updated to save time and effort. ClickOne ClickOnce ClickOn

ClickOnly 14. A form is a ____________ that holds and manages controls and is used to create GUI based Windows applications. collection frame property container 15. Which of the following controls belong to the category, Value setting controls? RadioButton CheckBox GridView ImageList 16. The ________________ control is used to display mutually exclusive options. CheckedListBox Checkbox RadioButton TreeView 17. The methods of the ________________ class are used to check an item, retrieve the checked state of an item, and clear all the selected items. Checkbox RadioButton CheckedListBox

UncheckedListBox 18. Selection List Controls enable selection of values from specified ranges with the help of the ________________ keys. Up-Down arrow Page Up - Page Down Ctrl-Shift Left-Right arrow 19. The ListView control is similar to the _____ icon on the standard toolbar of Windows Explorer. File Edit Views Tools 20. The _______________ control appears as a text box along with a drop-down calendar and displays the current date in a particular format. DateTimePicker MonthCalendar DropDownList Timer 21. The _______________ control appears as drop-down grid of rows and columns displaying the dates of a particular month. DateTimePicker MonthCalendar

Timer DropDownList 22. The ____________ property of the CrystalReportViewer class specifies or retrieves the index of the active view in the viewer control while the ___________ property specifies or retrieves the report to be bound to the control. ActiveViewIndex DisplayGroupTree SelectionFormula ReportSource 23. Which of the following properties of the MonthCalendar class specifies or retrieves a value, which indicates the color of days in months which are partially displayed in the control? TitleBackColor TitleForeColor TrailingForeColor ShowTodayCircle 24. Which of the following are the limitations of Interval property? 1. Less Frequency 2. Long Interval 3. Inaccuracy 4. Inexact Precision 1, 2, 3 2, 3, 4 1, 3, 4 1, 2, 3, 4

25. Which of the following are the features of dialog box? Which of the following are the features of dialog box? 1. It is not Resizable 2. It is Usual Model 3. It contains OK and Cancel buttons 1, 2 2, 3 1, 3 1, 2, 3

======================================================================

For retrieving data from the database, you must first connect to SQL Server database using ________________.

OleDbDataReader SqlConnection

SqlDataReader SqlCommand

A _______ object is a representation of database objects in the cached memory.

DataAdapter DataReader DataSet SqlCommand

The ________ class is used to sort, filter, search, modify, and navigate through the records of a table.

DataAdapter DataSet DataTable DataView

The _______ class helps to bind the property value of an object to the property value of a control.

Binding Control BindingSource SqlConnection

Crystal Reports allow you to generate reports using the ADO.NET object, ________.

DataAdapter DataSet DataTable DataView

The __________ method of the PrinterSettings class determines whether an image file can be printed.

IsDirectPrintingSupported CreateMeasurementGraphics

ToString Print

The .NET Framework is a ___________ and ___________ environment to build, deploy, and run applications.

multi-tiered multi-lingual open source multi-platform

GDI+ provides rich graphic support in the form of ____________ blending and ____________ brushes GDI.

alpha image paint texture

In the case of re-installing __________ technology based applications, only the modified parts of the application are

updated to save time and effort.

ClickOne ClickOnce ClickOn ClickOnly

10

A form is a ____________ that holds and manages controls and is used to create GUI based Windows applications.

collection frame property container

11

Which of the following controls belong to the category, Value setting controls?

RadioButton CheckBox

GridView ImageList

12

The ________________ control is used to display mutually exclusive options. Loai tru lan nhau

CheckedListBox Checkbox RadioButton TreeView

13

The methods of the ________________ class are used to check an item, retrieve the checked state of an item, and clear all the selected items.

Checkbox RadioButton CheckedListBox UncheckedListBox

14

Selection List Controls enable selection of values from

specified ranges with the help of the ________________ keys.

Up-Down arrow Page Up - Page Down Ctrl-Shift Left-Right arrow

15

The ListView control is similar to the _____ icon on the standard toolbar of Windows Explorer.

File Edit Views Tools

16

The _______________ control appears as a text box along with a drop-down calendar and displays the current date in a particular format.

DateTimePicker

MonthCalendar DropDownList Timer

17

The _______________ control appears as drop-down grid of rows and columns displaying the dates of a particular month.

DateTimePicker MonthCalendar Timer DropDownList

18

Timer is a _________ that generates an event at regular intervals.

event eventhandler control component

19

___________________ was the first data access model created for accessing local databases in the Microsoft Jet Database Engine format.

ActiveX Data Objects Data Access Objects Remote Data Objects Remote Procedure Calls

20

The ___________ class consists of a set of SQL commands and a database Connection object.

DataAdapter OleDbCommand DataSet SqlCommand

======================================================================
Cu 1 _____is any action directed at the application. [A] [B] [C] Event Method Class

[D]

Object

Cu [A] [B] [C] [D]

2____property is used to get or set the object that contains data about the control. Value Tag Text Name

Cu 3 Which of the following statement with respect to Data Grid control are True? (Choose all correct answers) [A] [B] [C] By default, the DataGrid display 1 page at a time. When the DataGrid control is set to a valid data source, the control is populated automatically Each field in the DataGrid is bound to a single column based on the DataSource

[D] The DataGrid control display data in tabular format and optionally supports data editing.

Cu 4 When an MDI parent form is closed, the Closing event of all MDI child forms are raised before the MDI parent forms Closing event is raised [A] [B] False True

Cu 5 What of the followings is correct for creating a command object with the connection con?
[A] [B] [C] [D] SqlCommand Cmd = con.SetSqlCommand(Select * From Student); SqlCommand Cmd = con.GetSqlCommand(Select * From Student); SqlCommand Cmd = new SqlCommand(con,Select * From Student); SqlCommand Cmd = new SqlCommand(Select * From Student, con);

Cu 6 The method can be used to draw a rectangle or a square depending on the coordinates passed as its argument. [A] [B] [C] [D] FillSquare FillRectangle DrawSquare DrawRetangle

Cu 7 General Project Properties are applicable to all project configurations and are set in the properties window. [A] [B] False True

Cu 8 Name the object which notifes other objects about an event [A] [B] [C] [D] Consumer Publisher Subscriber Tester

Cu 9 _____it the normal ouput type for a WinForm project [A] [B] [C] [D] Windows Application Console Application Class Library Windows Forms

Cu 10 We can generate Typed Dataset from a Datadapter [A] [B] False True

Cu 11 To preserve screen space on the monitor, VS.NET provides us with (Choose all answers) Note [A] [B] [C] [D] [E] [F] Class View Window Command Window Solution Explorer Window Auto-Hide Window Properties Window Tabbed Windows

Cu 12Images can be drawn using the _____method to of the Graphics class. [A] [B] [C] [D] PaintImage() DrawImage() CreateImage() FromImage()

Cu 13 DataSet store its data in XML [A] [B] False True

Cu 14 The ____control groups a set of controls within a non-labeled an scrollable frame [A] [B] [C] [D] PictureBox Tab Frame Panel

Cu 15 The ____feature of Windows Installer provider a standard method for distributing components and ensures that the installed component is of the correct version. [A] [B] [C] [D] VersionUpdate CAB Msi Merge Modules

Cu 16 To create an instance of the Font class using existing Font and FontStyle, the constructor is: [A] [B] [C] [D] [E] public void Font(string fontname, float size); public Font(FontStyle fs, Font f); public void Font(Font f, FontStyle fs); public Font(Font f, FontStyle fs); public Font(string fontname, float size);

Cu 17 Which control is used to display a short, customized help message for individual controls on a form? [A] [B] [C] [D] ToolTip HelpText HelpTool ToolClass

Cu 18 For using SQL.NET Data Provider what using statement of the following is correct? [A] [B] [C] [D] using System.Data; using System.Data.SqlServer; using System.Data.OleDb; using System.Data.SqlClient;

Cu 19 OLE is the abbreviation for ____ [A] [B] [C] [D] Object Like Environment Object Linking and Embedding Object Linking Environment Object Linking and Empower

Cu 20 Microsoft Windows Installer is shipped along with Windows 2000, Windows ME and Windows XP as an installation and configuration service. [A] [B] False True

Cu 21 Which namespace is VS.NET contains classes that help in constructing and sending emails? [A] [B] [C] [D] System.Web.Mail System.Mail System.Web.MailMessage System.Web.MailMessages

Cu 22 Statement 1: Tree View displays items like folders, drives etc. Statement 2: List View display items like current folder contents. [A] [B] [C] [D] Only statement 2 is true Both the statements are true Only statement 1 is true Both the statements are false

Cu 23 The DataAdapter method is used to fetch the values from the data source to the DataSet and also to update the data source with the DataSet data. [A] [B] False True

Cu 24 To perform a change to a table using the Command object named Cmd, what statement of the following correct? [A] [B] [C] [D] [E] Cmd.ExecuteReader() Cmd.ExecuteScalar() Cmd.ExecuteQuery() Cmd.ExecuteNonQuery() Cmd.ExecuteUpdate()

Cu 25 When a Data Form is created using the Data Form Wizard, which of the following classes are used by default?(Choose all correct answers) [A] [B] [C] [D] [E] [F] OleDbDataWriter OleDbDataAdapter OleDbStatement OleDbDataReader OleDbConnection OleDbCommand

Cu 26 ____property of a connection object is used to get or set the string used to open a database [A] [B] [C] [D] ConnectionParams ConnectionInfo StringConnection ConnectionString

Cu 27 property is used to get or set the data source that the grid is displaying data for. [A] [B] [C] [D] [E] DataSrc DataSource DataSet DataMember DataSender

Cu 28 _____property is used to get or set the edges of the control are anchored to the edges of its container. [A] [B] [C] [D] Hang Fixed Anchor Dock

Cu 29 MessageBox is a type of dialog box [A] [B] False True

Cu 30 OLE is the abbreviation for Object Linking and Embedding [A] [B] False True

Cu 31 control.

____property is used to get or set the shortcut menu associated with the

[A] [B] [C] [D]

PopUpMenu SubMenu ContextMenu MainMenu

Cu 32 The DataReader component is used to get the read-only and forward-only data from the data source. [A] [B] False True

Cu 33 System.Windows.Forms is an important____of the class libraries in .NET framework? [A] [B] Namespace Class

Cu 34 To get values of the columns of the i-th row in a DataTable object named datatable, what of the follwings is correct? [A] [B] [C] [D] DataColumn array = datatable.Rows[i].ItemArray; String[]array = datatable.Rows[i].ItemArray; Object[]array = datatable.Rows[i].ItemArray; DataRow array = datatable.Rows[i].ItemArray;

Cu 35 What mode is VS.NET allow you to step through each line of code and trace the execution of your application? [A] [B] [C] Neither Debug Mode nor Release Mode Both Debug Mode and Release Mode Release Mode

[D]

Debug Mode

Cu 36 Link Lable is commands control? [A] [B] [C] False True There is no link label control

Cu 37 Brushes can be created using one of the following classe(Choose all correct answers) [A] [B] [C] [D] [E] [F] [G] ThinBrush ThickBrush PlainBrush TextureBrush SolidBrush LinearGradientBrush GradientBrush

Cu 38 What mode is Brush allow you create a portable exe(EXE) file? [A] [B] [C] [D] Neither Debug Mode nor Release Mode Debug Mode Both Debug Mode and Release Mode Release Mode

Cu 39 What statement in the followings is correct I. The instance properties and methods are those, which are common to all the instances of the class.

II. The shared properties and methods are those, which are specific to a particular instance. [A] [B] [C] [D] Both of I and II statements are correct Both of I and II statements are incorrect Only II statement is correct Only I statement is correct

Cu 40 ADO.NET provides features for accessing traditional databases like SQL Server as well as databases, which are accessed using ____.(choose all correct answers) [A] [B] [C] [D] [E] ODBC VB.NET OLEDB XML DataSets

Cu 41 Name the .NET data providers which are available is VS.NET?(Choose all correct answers) [A] [B] [C] [D] [E] ODBC.NET Framework Data Provider SQL.NET Framework Data Provider OLEDB.NET Framework Data Provider Oracle.NET Framework Data Provider Access.NET Framework Data Provider

Cu 42 You can create your own table in DataSet [A] [B] False True

Cu 43 The____ event of the PrintDocument class is triggered immediately before each PrintPage event ocurs. [A] [B] [C] [D] StartPrint BeginPrint PrintPage QueryPageSettings

Cu 44 ___is the easiest way to allow the user to interact with the application. [A] [B] [C] [D] Label control Text control Button control Form

Cu 45 The term packaging imlies bundling up all the files in the application into a single file called a Distribution Unit [A] [B] False True

Cu 46 Which namespace does the class ListView belong to? [A] [B] [C] [D] System.Windows.Lists System.Windows.Drawing System.Windows.Paint System.Windows.Forms

Cu 47 The____property of a DataGrid control, allow filling various kinds of data in a DataGrid including data from a DataSet, DataViewManager, Arrays, Lists etc.

[A] [B] [C] [D] [E]

DataRecords FillSchema Fill FillData DataSource

Cu 48 The Pen class belongs to the ____namespace and cannot be inherited [A] [B] [C] [D] System.Painting System.GraphicsObjects System.Graphics System.Drawing

Cu 49 ____are the visual effects supported in WinForms (Choose all correct answers). [A] [B] [C] [D] [E] [F] [G] Collections Class Libraries Opaque Forms Visual Inheritance Control Anchoring Cotrol Docking Transparent Forms

Cu 50 Help is one of the most important but then also mostly forgotten part of any application [A] [B] False True

Cu 51 Which class represents shortcut menus that can be displayed when the user clicks the right mouse button over a control or area of the form?

[A] [B] [C] [D]

ToolMenu MainMenu ContextMenu FileMenu

Cu 52 The value of the HelpButton property is ignored if the maximize of minimize boxes are shown. [A] [B] False True

Cu 53 List the key elements of COM (choose all correct answers) [A] [B] [C] [D] A set of theorems which must be proven for checking the correctness of the object model A set of graphical symbol for modeling the objects A set of services for creating and exposing the classes A set of specifications defining the programming protocol

Cu 54 ____ are the Print support controls provided by WinForms.(Choose all correct answers) [A] [B] [C] [D] [E] PrintPreview PrintFile PrintPreviewControl PrintDirectory PrintDocument

Cu 55 What of the followings are data validation mode in WinForms?(Choose all correct answers) [A] [B] Form-Level Validation There is no Data validation mode in Winforms

[C] [D]

Control-Level Validation Field-Level Validation

Cu 56 What of the folllowings is correct if we want to set the Achild form as a child form of the parent form named TheParent? [A] [B] [C] [D] [E] AChild.MdiParent = TheParent; AChild.TheParent = true; Achild.MdiChild = AChild; TheParent.MdiChild = AChild; TheParent.AChild = true;

Cu 57 Class Library is one of the main components of the .NET framework and is divided in to ____ [A] [B] [C] Namespaces DLL components GUI components

Cu 58 To bind data to controls as ListBox, ComboBox, DataGrid, what type of data bindings shoud you use? [A] [B] [C] [D] Hybrid Data Binding Complex Data Binding Simple Data Binding Structured Data Binding

Cu 59 The ____control groups a set of controls within a non-labeled and scrollable frame [A] [B] PictureBox CheckedBox

[C] [D]

Panel Frame

Cu 60 ____property is used to get or set a value that is returned to the parent form when the button is clicked. [A] [B] [C] [D] [E] ButonResult DialogResult ButtonValue ResultValue ResultDialog

Cu 61 Arrange the sequence in which the key events are triggered


[A] [B] [C] [D] [E] [F] KeyPress, KeyUp, KeyDown KeyUp, KeyPress, KeyDown KeyDown, keyPress, KeyUp KeyPress, keyDown, KeyUp KeyUp, KeyDown, KeyPress KeyDown, KeyUp, KeyPress

Cu 62 The types of list box supported in Winforms are(Choose all correct answers) [A] [B] [C] [D] ListBox CheckedListBox ComboBox DropDownbox

Cu 63 What are thee steps involved involved in calling one from another form?(choose all answers) [A] Create an instance of the calling form

[B] [C]

Create an instance of the form to be called Invoke Show

Cu 64 Which Control is used to display the current status of the application using framed windows? [A] [B] [C] [D] TreeView StatusBar ToolBar ListView

Cu 65 Which of the following objects can we use to read data from a Micorosoft SQL Server 2000 database? (choose all correct answers) [A] [B] [C] [D] [E] SQLDataAdapter DataSet OleDbDataAdapter ADORecordSet XmlTextReader

Cu 66 Use DataReader when we want to have data scrollable


[A] [B] False True

Cu 67 What is component is used to fetch the values from the data source to DataSet and also update the data source with data in the DataSet? [A] [B] [C] [D] DataWriter DataReader DataAdapter DataCommand

Cu 68 The ____property of the Form control is used to determine whether there are any MDI child forms open in your MDI application.
[A] [B] [C] [D] ActiveMdiChildren ActiveMdiChild IsMdiChild IsMdiChildren

Cu 69 ____are the collection of reusable classes or types [A] [B] [C] Namespaces Collections Class libraries

Cu 70 ____control combines the features of the TextBox and the ListBox controls [A] [B] [C] [D] ToolBar StatusBar Label ComboBox

Cu 71 A custom control should you use to verify an authorized aplication user called as _____ [A] [B] [C] [D] Composite Custom Control Standard Control Single Control Complex Control

Cu 72 Each Merge Module holds distinctive version details that are used by Windows Installer [A] [B] False True

Cu 73 Which of the following statements with respect to ADO.Net are True? (Choose all correct answers) [A] [B] [C] [D] System built on ADO.NET are intrinsically highly scaleable ADO.NET objects are all strongly typed. When we use the DataSet object, ADO.NET is based on disconnected data access. in ADO.NET, the RecordSet is bound to the data source

Cu 74 The method ____of the Control class conceals the control from the user. [A] [B] [C] [D] Close visible Dispose Hide

Cu 75 What control support us to display the list items in different types as text only, text with small icons, text with large icons and report views? [A] [B] [C] [D] ListView ListBox CheckedListBox ComboBox

Cu 76 IntelliSence pops up a list of _____that can be called on an object (Choose all correct answers). Xem lai [A] [B] Hints Values

[C] [D] [E]

Properties Links Tags

Cu 77 The____ control is used to display text when the mouse points to a particular control [A] [B] [C] [D] Toolbar StatusBar Menu ToolTip

Cu 78 What are the types of Dialog boxes?(choose all correct answers) [A] [B] [C] [D] Custom dialog boxes Common dialog boxes Modeless dialog boxes Modal dialog boxes

Cu 79 which class is the base class for all the controls that can be used in Windows Forms? [A] [B] [C] [D] Control Controls Forms Objects

Cu 80 GDI + resides in _____ assembly. [A] [B] System.Painting System

[C] [D]

System.Graphics System.Drawing

Cu 81 The ____ property of the LinkLabel control is used to specity the text, which has to be displayed as a link. [A] [B] [C] [D] HyperLink URLName LinkName LinkArea

Cu 82 What of the following are correct for creating a connection object to database named MyDB? (Choose all correct answers) [A] SqlConnection con = new SqlConnection(server=myserver; Integrated Security = SSPI; database=MyDB); [B] SqlConnection con = new SqlConnection(server=myserver Intergrated Security=SSPI; Data Source=MyDB); [C] SqlConnection con = new SqlConnection(Data Source=myserver; Integrated Sercurity=SSPI; Initial Catalog=MyDB);

Cu 83 List the advantages of DCOM (Choose all correct answers) [A] [B] [C] [D] Provides Location Transparency(Distributed Architecture) Platform independent Fully Language Independent Supports version compatibility

Cu 84 The view types supported in Winforms are (choose all correct answers) [A] [B] [C] [D] Text with large icons Text only Text with small icons Report view

Cu 85 If maximize and minimize buttons are displayed then the HelpButton property is ignored. [A] [B] False True

Cu 86 The ____ event of the Form control is used to perform tasks such as allocating resources used by the form [A] [B] [C] [D] Allocate Activate Load Activated

Cu 87 To get values of the colums of the i-th row in a DataTable object named datatable, what of the followings is correct? [A] [B] [C] [D] Object [] array = datatable.Rows[i].ItemArray; DataColumn array = datatable. Rows[i].ItemArray; String[] array = datatable. Rows[i].ItemArray; DataRow array = datatable. Rows[i].ItemArray;

Cau 88:-ADO.Net.Provider features for accessing traditional database like SQL Server as well as databases , which are accessed using ___ .

[A]TL: OLEDB + XML

Cau 89 -Dataset store its data inXML

[A]Tl: true

Cau 90-IntelliSence pops up a list of ___ that can be called on an onject

[A]Tl: Hints + Properties

Cau 91 -Link Label is a commands control

[A]Tl: true

Cau 92-Microsoft Windows Installer is shipped alog with Windows 2000, windows ME and Windows XP as an installtion and configuration sevice.

[A]Tl: True

Cau 93 --The___event of the Form control is used to perform tasks such as allocating

resources used by the form

[A]Tl: Allocate

Cau 94 -To preserve screen space on the monitor , VS.NET provides us with Tl: SolutionExplorer Window + Tabbed Windows + Class View Window + Command Windows + Properties Window

Cau 95 -The term packaging imlies bunding up all the files in the application into a single file

called a Distribution Until Tl: True ======================================================================

Windows Form

Which of the following is not a possible value for the RowState property of a DataRow object? 1 a) Added b) Altered c) Deleted d) Modified

The Windows Form classes are located in the ________ namespace 2 a) b) System.Windows.Forms System.WindowsForms c) d) System.WinForms Windows.Forms

The _____ argument and the _____ argument are always passed as parameters to events for a control (choose 2) a) 3 b) c) d) System.Object System.EventArgs System.EventHandler System.Controls

You have Visual Studio .NET to develop a Windows-based application that interacts with a Microsoft SQL Server database. Your application contains a form name EmployeeForm. You add the following design-time component to the form + SqlConnection object name EmpConn + SqlDataAdapter object name EmpDA + DataSet object name EmpDS + Five TextBox controls to hold the values exposed by EmpDS At design-time, you set DataBindings property of each TextBox control to appropriate column in the DataTable object of EmpDS. When you test this application you can successfully connect to the database. However, no data is displayed in any TextBox. You need to modify your application code ensure that data is displayed appropriately. Which behavior should occur while the EmployeeForm.Load event handler is running? a) b) Execute the BeginInit method of EmpDS Execute the Open method of EmpConn

c) d)

Execute the FillSchema method of EmpDA and pass in EmpDS Execute the Fill method of EmpDA and pass in EmpDS

Which of the following events is best suitable to validate the data? a) 5 b) c) d) KeyUp Validated Validating LostFocus

You use Visual Studio .NET to create a Windows-based application. The application includes a form name CertK, which displays statistical date in graph format. You use a custom graphing control that does not support resizing. You must ensure that users cannot resize, minimize or maximize CertK. Which three actions should you take? (choose 3) a) 6 b) c) d) e) f) Set CertK.MinimizeBox to False Set Cert.MaximizeBox to false Set Cert.ControlBox to false Set Cert.ImeMode to Disabled Set Cert.WindowState to Maximized Set Cert.FormBorderStyle to one of the Fixed Styles

You develop a Visual Studio .NET application that dynamically adds controls to its form at runtime. You include the following statement at the top of your file: using System.Windows.Forms; In addition, you create the following code to add Button controls: Button tempButton = new Button(); tempButton.Text = NewButtonCaption; tempButton.Name = NewButtonName; tempButton.Left = NewButtonLeft; tempButtonTop = NewButtonTop; 7 this.Controls.Add(tempButton); tempButton.Click += new EventHandler(ButtonHandler); Variables are passed into the routine to supply values for the Text, Name, Left, Top properties. When you compile this code, you receive an error message indicating that ButtonHandler is not declared. You need to add a ButtonHandler routine to handle the Click event for all dynamically added Button controls. Which declaration should you use for ButtonHandler? a) b) c) d) e) public void ButtonHandler() public void ButtonHandler(System.Windows.Forms.Button sender) public void ButtonHandler(System.Object sender) public void ButtonHandler(System.Windows.Forms.Button sender, System.EventArgs e) public void ButtonHandler(System.Object sender, System.EventArgs e)

Your application uses a DataSet object to maintain a working set of data for your users. Uses frequently change information in the DataSet object. Before you update your database, you must run data validation code on all user changes. You need to identify the data rows that contain changes. First you create a DataView object. What should you do next? 8 a) b) c) d) Set the RowStateFilter.CompareTo method Set the RowStateFilter.Equals method Set the RowStateFilter property to CurrentRow Set the RowStateFilter property to ModifiedCurrent

You need to develop a Windows form that provides online help for users. You want the help functionality to be available when users press F1 key. Help text will be displayed in a popup window for the textbox has focus. To implement this functionality, you need to call a method of HelpProvider control and pass the text box and the help text. What should you do ? 9 a) b) c) d) SetShowHelp SetHelpString SetHelpKeyword ToString

You use Visual Studio .Net to develop a Windows-based application. Your application will display customer order information from a Microsoft SQL Server database. The orders will be display on Windows Form that includes a DataGrid control which is bound to a DataView object. Users will be able to edit order information directly in the DataGird control. You must give users the option of displaying only edited customer orders and updated values in the DataGrid. What should you do? 10 a) b) c) d) Set the RowStateFilter property of the DataView object to DataViewRowState.ModifiedOriginal. Set the RowStateFilter property of the DataView object to DataViewRowState.ModifiedCurrent Set the RowFilter property of the DataView object to DataViewRowState.ModifiedOriginal. Set the RowFilter property of the DataView object to DataViewRowState.ModifiedCurrent

You use Visual Studio.Net to develop a Microsoft Windows-based application. Your application contains a form named CustomerForm, which is includes the following design-time controls: SQL Connection object named CustConnection SQL DataAdapter object named CustDataAdapter DataSet object named CustomerDataSet Five TextBox controls to hold the values exposed by CustomerDatSet Button control named saveButton At design time you set the DataBindings properties of each TextBox control to the appropriate column in the DataTable object of CustomerDataSet. When the application runs, users must be able to edit the information displayed in the text boxes. All user changes must be saved to the appropriate database when saveButton is executed. The event handler for saveButton includes the following code segment: 11 CustDataAdapter.Update(CustomerDataSet);

You test the application. However, saveButton fails to save any values edited in the text boxes. You need to correct this problem. What should your application do? a) b) c) d) Call the InsertCommand method of CustDataAdapter Call the Update method of CustDataAdapter and pass in CustConnection Before calling the Update method, ensure that a row position change occurs in CustomerDataSet. Reestablish the database connection by calling the Open method of CustConnection.

You are deploping a Window-based application that logs hours worked by employees. Your design goals require you to maximize application performance and minimize impact on server resources. Your need to implement a SqlCommand object that will send a SQL INSERT action query to a database each time a user makes a new entry. To create a function named LineItemInsert, you write the following code (Line numbers are included for reference only). 01 : public int LineItemInsert(int empID, int projectID, 02 : decimal hrs, SqlConnection con) 03 : { 04 : string SQL; 05 : int Ret; 06 : 07 : SQL = String.Format ( 08 : INSERT INTO TimeEntries (EmpID, ProjectID, Hours) 09 + 10 : VALUES ({0},{1},{2}), 11 : empID, projectID, hrs); 12 12 : SqlCommand cmd = new SqlCommand(SQL, con); 13 : 14 : //Insert new code 15 : } You code must execute the SQL INSERT action query and verify the number of database records that are affected by the query. Which code segment should you add on line 14 ?

a)

con.Open(); Ret = cmd.ExecuteNonQuery(); con.Close(); return Ret;

b) c)

con.Open(); Ret = cmd.ExecuteScalar(); con.Close(); return Ret; SqlDataReader reader; con.Open(); reader = cmd.ExecuteReader(); con.Close(); return reader.RecordsAffected;

d)

SqlDataReader reader; con.Open(); reader = cmd.ExecuteReader(); con.Close(); return reader.GetValue();

The_________ event of the Form control is used to perform tasks such as allocating resources used by the form. a) 13 b) c) d) Activate Load Allocate Activated

When a Data Form is created using the Data Form Wizard, which of the following classes are used by default? (choose 4 ) a) 14 b) c) d) e) OleDbDataReader OleDbConnection OleDbCommand OleDbDataWriter OleDbDataAdapter

To create an instance of the Font class using existing Font and FontStyle, the constructor is: a) 15 b) c) d) public Font(Font f, FontStyle fs); public Font(string fontname, float size); public void Font(Font f, FontStyle fs); public void Font(string fontname, float size);

Which control is used to display a short, customized help message for individual controls on a form? a) 16 b) c) d) ToolClass HelpTool HelpText ToolTip

Statement 1: Tree View displays folders, drives etc. 17 Statement 2: List View displays current folder contents. a) Both the statements are true

b) c) d)

Only Statement 1 is true Only Statement 2 is true both the statements are false

Which class represents shortcut menus that can be displayed when the user clicks the right mouse button over a control or area of the form? a) 18 b) c) d) Menu FileMenu ContextMenu ToolsMenu

Name the object which notifies other objects about an event? a) 19 b) c) d) Publisher Subscriber Consumer Tester

Leo would like to populate a select dropdown combo box with data in a data store. He wants a fast, forward only, read-only database connection using ADO.NET. 20 Given the above scenario, which one of the following objects should Leo use? a) b) A DataAdatpter object A Command object c) d) A DataReader object A Connection object

Which class is the base class for all the controls that can be used in Windows Forms? a) 21 b) c) d) Objects Forms Controls Control

Which of the following statements about event handlers is not true? a) 22 b) c) d) Event handlers cannot be removed dynamically Event handlers are methods that handle events Event handlers can handle multiple events Multiple event handlers can be associated with an event

Which of the following namespaces defines the Trace and Debug classes? a) 23 b) c) d) System.Diagnostics System.Collection System.Security System.ComponentModel

By setting the _________ in a control, I can make sure that my code is not change if someone inherits my form. a) 24 b) c) d) the Private value of the Modifiers property the Unchanged value of the Modifiers property the Restricted value of the Modifiers property the Limited value of the Modifiers property

You are using Visual Studio.Net to develop a Windows- based application that contains a single form. This form contains a label control named labelUser and a textbox control named textUser, labelUser displays a caption that identifies the purpose of textUser. You want to write code that enables users to place focus in textUser when they press Alt + U. This key combination should be identified to users in the display of labelUser. Which 3 actions should you take? (choose 3) 25 a) b) c) d) e) Set labelUser.UserMnemonic to True Set labelUser.CauseValidation to True Set textUser.CauseValidation to True Set textUser.TabIndex to exactly one number more than labelUser.TabIndex Set labelUser.Text to &User

You have created a Class Library of Custom User controls and Forms. You want to use this class library as the foundation for your Windows application project. How can you reference it? a) In the class View, right click on the project and select Add Inherited Control for user controls or select Add Inherited Form for Forms. Name the component and click Open.Select component in the inheritance picker dialog box. In the Solution Explorer, right-click on the project and select Add Inherited Control for user controls or select Add Inherited Form for Forms. Name the component and click Open.Select component in the inheritance picker dialog box. From the Menu select Project\ Add Inherited Control for user controls or select Project\ Add Inherited Form for forms. Name the component and click Open. Select component in the inheritance picker dialog box. From the Menu select Build\ Add Inherited Control for user controls or select Build\ Add Inherited Form for forms. Name the component and click Open. Select component in the inheritance picker dialog box.

26

b)

c)

d)

You use Visual Studio.Net to develop a Windows-based application for a womens college. Your application will display students information from a Microsoft SQL Server database. The information will be displayed on a Windows Form in a data grid named dg1. DataGrid1 is bound to a DataView object. The Windows form includes a button control named displayStudent. When users click this button, dgl must display only student information whose PaidFees value is set to True. How would you achieve this? 27 a) b) c) d) Set the RowFilter property of the dg1 object to PaidFees = True Set the RowStateFilter property of the dg1 object to PaidFees = True Set the RowFilter property of the DataView object to PaiFees = True Set the RowStateFilter property of the DataView object to PaiFees = True

You use Visual Studio.Net to create a Windows-based application. The application includes a form that several controls, including a button named exitButton. After you finish designing the form, you select all controls and then select Lock Controls from the Format menu least possible effort, and without disrupting the other controls. First you select exitButton in the Windows Forms Designer. What should you do next? a) 28 Set the Locked property to True b) Set the Locked property to False Use this mouse to resize the control Set the Locked property to True c) Set the Size property to the required size Set the Locked property to False Set the Size property to the required size

d)

Use this mouse to resize the control

You develop a Windows-based application that includes the following code segment. (Line numbers are included for reference only) 01 private void Password_Validating(object sender, 02 System.ComponentModel.CancelEventArgs e) 03 { 04 if(ValidCertKingPassword() == false) 05 { 06 // insert new code 29 07 } 08 } You must ensure that users cannot move control focus away from textPassword if ValidCertKingPassword returns a value of False. You will add the required code on line 6

a) b) c) d)

e.Cancel = true; sender = name; password.AcceptsTab = false; password.CausesValidation = false;

You use Visual Studio.Net to create a data entry form. The form enables users to edit personal information such as address an telephone number. The form contains a text box named textPhoneNumber. If a user enters an invalid telephone number, the form must notify the user of the error. You create a function named IsValidPhone that validates the telephone number entered. You include an ErrorProvider control named ErrorProvider1 in your form. Which additional code segment should you use? 30 a) private void textPhone_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if(!IsValidPhone()) { errorProvider1.SetError(textPhone, Invalid Phone); }}

b)

private void textPhone_Validated(object sender, System.EventArgs e) { if(!IsValidPhone()) { errorProvider1.SetError(textPhone, Invalid Phone); }}

c)

private void textPhone_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if(!IsValidPhone()) { errorProvider1.GetError(textPhone); }}

d)

private void textPhone_Validated(object sender, System.EventArgs e) { if(!IsValidPhone()) { errorProvider1.GetError(textPhone); }}

e)

private void textPhone_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if(!IsValidPhone()) { errorProvider1.UpdateBinding(); }}

f)

private void textPhone_Validated(object sender, System.EventArgs e) { if(!IsValidPhone()) { errorProvider1.UpdateBinding(); }}

You develop a Windows-based application. Its users will view and edit employee attendance data. The application uses a DataSet object named customerDataSet to maintain the data while users are working with it. After a user edits data, business rule validation must be performed by a middle-tier component named Certk Component. You must ensure that your application sends only edited data rows from customDataSet to CertK Component. 31 Which code segment should you use? a) DataSet changeDataSet = new DataSet(); if(customDataSet.HasChanges) { CertK Component.Validate(changeDataSet); }

b)

DataSet changeDataSet = new DataSet(); if(customDataSet.HasChanges) { CertK Component.Validate(customDataSet); }

c)

DataSet changeDataSet = customDataSet.GetChanges(); CertK Component.Validate(changeDataSet);

d)

DataSet changeDataSet = customDataSet.GetChanges(); CertK Component.Validate(customDataSet);

You develop a new sales analysis application that reuses existing data access components. One of these components returns a DataSet object that contains the data for all customer orders for the previous years. You want your application to display orders for individual product numbers. Users will specify the appropriate product numbers at runtime. What should you do? 32 a) b) c) d) Use the DataSet.Reset method. Set the RowFilter property of the DataSet object by using a filter expression. Create a DataView object and set the RowFilter property by using a filter expression. Create a DataView object and set the RowStateFilter property by using a filter expression.

You develop a Windows-based application which uses a DataSet object that contains two DataTable objects. The application will display data from two data tables. One table contains customer information, which must be displayed in a data-bound ListBox control. The other table contains order information which must be displayed in a DataGrid control. You need to modify the application to enable the list box functionality. 33 What should you do? a) b) c) d) Use the DataSet.Merge method. Define primary keys for the Data Table objects. Create foreign key constraint on the DataSet object. Add a DataRelation object to the Relations collection of the DataSet object.

You use Visual Studio.Net to create a control that will be used on serveral forms in your application. It is a custom label control that retrieves and displays your companys current stock price. The control will be displayed on many forms that have different backgrounds. You want the control to show as much of the underlying forms as possible. You want to ensure that only the stock price is visible. The rectangular control itself should not be visible. You need to add code to the Load event of the control to fulfill these requirements. Which two code segments should you use? (Each correct answer presents part of the solution. Choose 2) 34 a) b) c) d) e) this.BackColor = Color.Transparent; this.ForeColor = Color.Transparent; this.BackImage = null; this.SetStyle(ControlStyles.UserPaint, false); this.SetStyle(ControlSyles.SupportsTransparentBackColor, true);

When a Windows Application project is created in Visual C#, a form is created automatically with the class name as __________. a) 35 b) c) d) Class1 Form1 Form0 ClassA

The __________ and __________ class has properties that hold the SQL statements to select, insert, update and delete data from the database. (choose 2) a) 36 b) c) d) OleDbDataAdapter SqlDataAdapter OracleDataAdapter OdbcDataAdapter

The __________ method is used to create the Graphics object a) 37 b) c) CreateGraphics Create CreateGraph

d)

DrawGraph

The _________ event of the PrintDocument class is trigged immediately before each PrintPage event occurs. a) 38 b) c) d) QueryPageSettings PrintPage BeginPrint StartPrint

________ is used to display text or data in the form of nodes arranged in a hierarchical order? a) 39 b) c) d) ListView TreeView TaskView NodeView

Which namespace does the class ListView belong to? a) 40 b) c) d) System.Windows.Drawing System.Windows.Forms System.Windows.Paints System.Windows.Lists

Which of the following statements are True with respect to Data Set in ADO.Net? (choose 2) a) 41 b) c) d) DataSet is an in-memory cache of records that can be visited/ modified any direction. The DataSet is a read only cursor. A DataSet can contain only two data tables at a time corresponding to a database table or view. A DataSet constitutes a disconnected view of the data present in the database.

42

Select the features of a good user interface? (choose 3)

a) b) c) d) e)

Easy to learn Easy to use Attractive Easy to develop Colorful

Which class is the base class for all the controls that can be used in Windows Forms? a) 43 b) c) d) Objects Forms Controls Control

Which of the following techniques for creating a control is the easiest and least time-consuming? a) 44 b) c) d) Inheriting from an existing control Inheriting from UserControl Inherting from Control Creating from scratch

Which of the following types of error occurs when the compiler is unable to compile a code? a) 45 b) c) d) Syntax error Runtime error Logical error Debugging error

The ________ property will allow you to loop through the collection of MdiChild forms in your application. You can use the ________ property to determine the number of open MdiChildren in your application. 46 a) b) MdiChildren, MdiChildren.Length MdiForms, MdiForms.Length

c) d)

MdiChild, MdiChild.Length MdiChildren, MdiChildren.No

You are developing an ERP application for Customer Officer. You are working on the e-mail form of the Windows application. You use the TabControl control and want it to always fill the forms. You also want the form to be resizable. How can you efficiently implement this feature? 47 a) b) c) d) Set the Anchor property of the TabControl control to Top, Bottom. Set the Dock property of the frmIssueDescription form to Fill. Set the Dock property of the TabControl control to Left, and set the Anchor property to Right. Set the Dock property of the TabControl control to Fill.

What happens when you assign the same access key to more than one menu item in the same menu group? a) 48 b) c) Nothing happens. You cannot assign the same access key to more than one menu item. Pressing the access key will switch between the items with the same access key, and the user must press ENTER to select the items If this access key is used, the first item in the menu that has the access key assigned to it will be selected.

d)

You create a Windows Forms named CertKing Form. This form enables users to maintain database records in a table named CertKing. You need to add several pairs of controls to CertKing Form. You must fulfill the following requirements: Each pair of controls must represent one column in the CertKing table. Each pair must consist of a TextBox control and a Label control. The LostFocus event of each TextBox control must call a procedure named UpdateDatabase. Additional forms similar to CertKing Form must be created for other tables in the database. Application performance must be optimized. The amount of necessary code must be minimized. What should you do? a) Create and select a TextBox control and a Label control. Write the appropriate code in the LostFocus event of the TextBox control. Repeatedly copy and paste the controls into CertKing form until every column in the CertKing table has a pair of controls. Repeat this process for the other forms.

49

b)

Add a TextBox control and a Label control to CertKing Form. Write the appropriate code in the LostFocus event of the TextBox control. Create a control array form the TextBox control and the Label control. At runtime, add additional pairs of controls to the control array until every column in the CertKing table has a pair of controls. Repeat this process for the other forms.

c)

Create a new user control that includes a TextBox control and a Label control. Write the appropriate code in the LostFocus event of the TextBox control. For each column in the CertKing table, add one instance of the user control to CertKing Form. Repeat this process for the other forms.

d)

Create a new ActiveX control that includes a TextBox control and a Label control. For each column in the CertKing table, add one instance of the ActiveX control to CertKing Form. Repeat this process for the other forms.

You use Visual Studio.Net to develop a Windows-based application that contains a single form. This form contains a Label control named labelTKValue and a TextBox control named textTKValue. labelValue displays a caption that identifies the purpose of textTKValue. You want to write code that enables users to place focus in textTKValue when they press ALT+V. This key combination should be identified to users in the display of labelTKValue. Which three actions should you take? (Each correct answer present part of the solutions? 50 a) b) c) d) e) f) Set labelTKValue.UseMnemonic to True. Set labelTKValue.Text to &Value. Set labelTKValue.CauseValidation to True. Set textTKValue.CausesValidation to True. Set textTKValue.TabIndex to exactly one number less than labelValue.TabIndex. Set textTKValue.TabIndex to exactly one number more than labelValue.TabIndex.

You develop an application that enables users to enter and edit purchase order details. The application includes a Windows Form named Display CertKing Form. The application uses a clientside. DataSet object to manage date. The DatatSet object contains a Data Table object named CertKing Details. This object includes one column named Quantity and another named UnitPrice. For each item on a purchase order, your application must display a line item total in a DataGrid control on Display CertKing Form. The line item is the product of Quantity times UnitPirce. Your database design dose not allow you to store calculated values in the database. You need to add code to you Form_Load procedure to calculate and display the line item total. Which code segment should you use? a) DataColumn totalColumn = new DataColumn(Total, Type.GetType(System.Decimal)); 51 CertKing Details.Columns.Add(totalColumn); totalColum.Expression = Quantity * UnitPrice; b) DataColumn totalColumn = NewDataColumn(Total,Type.GetType(System.Decimal)); CertKing Details.Columns.Add(totalColumn; TotalColumn.Equals(Quantity* UnitPrice ); c) d) CertKing Details.DisplayExpression(Quantity * Unitprice); CertKing Details.DisplayExpression(quantityColumn * unitPriceColumn)

You use Visual Studio. Net to create a form that includes a submenu item named helpTKOption. In the Click event handler for helpOption, you write code to open a Web browser loaded with a context sensitive Help file. You add a ContextMenu item named ContextMenu1 to the form. ContextMenu1 will be used for all controls on the form. Now you need to add code to the Popup event handler for ContextMenu1. Your code will create a popup menu that offers the same functionality as help TKOption. You want to use the minimum amount of code to accomplish this goal. 52 Which two code segment should you use? (Each correct answer present part of the solution.) a) b) c) d) ContextMenu1.MenuItems.Clear(); ContextMenu1.MenuItems.Add(&Display.Help); ContextMenu1.MenuItems[0].Click += new System.EventHandler(helpTKOption_Click) ContextMenu1.Popup += new System.EventHanler(helpTKOption_Click)

You develop a Windows- based application that will retrieve CertKing employee vacation data and display it in a DataGrid control. The data is managed locally in a DataSet object named employeeDataSet. You need to write code that will enable users to sort the data by department. Which code segment should you use? a) DataView dvDept = new DataView(); dvDept.Table = employeeDataSet.Tables[0]; dvDept.Sort = ASC; DataGrid1.DataSource = dvDept; b) 53 DataGrid1.DataSource = dvDept; c) DataView dvDept = new DataView(); dvDept.Table = employeeDataSet.Tables[0]; dvDept.ApplyDefaultSort = true; DataGrid1.DataSource = dvDept; d) DataView dvDept = new DataView(); dvDept.Table = employeeDataSet.Tables[0]; dvDept.ApplyDefaultSort = false; DataGrid1.DataSource = dvDept; DataView dvDept = new DataView(); dvDept.Table = employeeDataSet.Tables[0]; dvDept.Sort = Department;

You use Visual Studio.Net to develop a Windows- based application. Your application will display customer order information form a Microsoft SQL Server database. The orders will be displayed on a Windows Form in a data grid named DataGrid1. DataGrid1 is bound to a DataView object. The Windows Form includes a button control named displayBackOrder. When users click this button, DataGrid1 must display only customer orders whose BackOrder value is set to True. How should you implement this functionality? 54 a) b) c) d) Set the RowFilter property of the DataView object to BackOrder = true Set the RowStateFilter property of the DataView object to BackOrder = True Set the Sort property of the DataView object to BackOrder = true Set the ApplyDefaultSort property of the DateView object to true

You develop a Windows- based application to manage business contacts. The application retrieves a list of contacts from a central database. The list of contacts is managed locally in a DataSet object named contactDataSet. 55 To set the criteria for retrieval, your user interface must enable users to type a city name into a TextBox control. The list of contacts that match this name must then be displayed in a DataGrid control. Which code segment should you use?

a)

DataView contactDataSet = new DataView(); dv.Table = contactDataSet.Tables[0]; dv.RowFilter = TextBox1.Text; DataGrid1.DataSource = dv;

b)

DataView dv = new DataView(); dv.Table = contactDataSet.Tables[0]; dv.RowFilter = String.Format(City={0}, TextBox1.Text); DataGrid1.DataSource = dv;

c)

DataView contactDataSet = new DataView(); dv.Table = contactDataSet.Tables[0]; dv.Sort = TextBox1.Text; DataGrid1.DataSource = dv;

d)

DataView dv = new DataView(); dv.Table = contactDataSet.Tables[0]; dv.Sort = String.Format(City={0}, TextBox1.Text); DataGrid1.DataSource = dv;

Which of the following statements with respect to ADO.Net are True? (Choose 3) a) 56 b) c) d) In ADO, the RecordSet is bound to the data source When we use the DataSet object, ADO.Net is based on disconnected data access. ADO.Net objects are all strongly typed. Systems built on ADO.NET are intrinsically highly scaleable

Which of the following statements with respect to Data Grid control are True? (choose 3) a) 57 b) c) d) When the DataGrid control is set to a valid data source, the control is populated automatically. Each field in the DataGrid is bound to a single column based on the DataSource By default, the DataGrid displays 1 page at a time. The DataGrid control displays data in a tabular format and optionally supports data editing.

Which Control is used to display the current status of the application using framed windows? a) 58 b) c) d) StatusBar ToolBar TreeView ListView

Which event occurs when the form is closed? a) 59 b) c) d) Closes Delete Close Closed

Which namespace in VS.Net contains classes that help in constructing and sending emails? a) 60 b) c) d) System.Web.MailMessage System.Web.MailMessages System.Web.Mail System.Mail

Which control is used to link an HTML file with the Winforms application? a) 61 b) c) d) HelpString HelpProvider HelpText HelpButton