Sunday, July 6, 2008

VB.Net Frequently Asked Questions and answers

1. Statement A : When the pull model is used to access data from the data source, the database driver directly retrieves the data from the data source
Statement B: In the case of the pull model, Crystal Report creates and manages the SQL commands for connecting to the data source and retrieving data from it
Evaluate the above statements
a. Statement A is incorrect and Statement B is correct
b. Statement A is correct and Statement B is incorrect
c. Both statements are incorrect
d. Both statements are correct

2.Statement A: Data Binding is of two types, simple and complex.
Statement B Complex data binding involves a control to a DataGrid.
Evaluate the above statements
a. Both statements are correct
b. Statement B is Correct but Statement A is incorrect
c. Both statements are incorrect
d. Statement A is correct but statement B is incorrect

3. Statement A : The Link Label control is used to display the text on a Windows Form as
link
Statement B : The LinkLabel control allows you to create links to a web site only
Evaluate the above statements
a. Both statements are correct
b. Both statements are incorrect
c. Statement A is correct and Statement B is incorrect
d. Statement A is incorrect and Statement B is correct

4.When using a parameterized query, which of the following is the best place for using the Fill() method of the data adapter to fill the dataset object?
a. In the Click event of a button specified for the execution of the parameterized query
b. In the Load event of the form
c. In the Activate event of the form
d. In the RowUpdated event of the OleDbDataAdapter object

5.Which of the following is not an event raised by the DataTable object when changes are made in a dataset
a. RowDeleted b.RowDeleting c.ColumnChanging d.RowState

6. Statement A: A Do-Loop and While-End while are examples of decision structures
Statement B: Decision structure help you to regulate the flow of a program
a. Statement A is correct but Statement B is incorrect
b. Statement B is correct but statement A is incorrect
c. Both Statements are correct
d. Both Statements are incorrect

7.Which statement is true for a function procedure
a. It returns a value to the calling code
b. It is used to define a property as read-only, write-only, or read/write type
c. It has Private access by default
d. It does not return a value.



8.Statement A: An Interface contains the declaration of properties methods and events
Statement B: Namespace help you to create logical groups of interfaces.
Evaluate the above statements
a. Both statements are correct
b. Both statements are incorrect
c. Statement A is correct and Statement B is Incorrect
d. Statement A is incorrect and Statement B is correct

9.Statement A : After retrieving data in a dataset, you can filter the data by using the filter() method or by using Data View objects.
Statement B : A Data View object allows a fixed customized view of a given DataTable object
Evaluate the above statements
a. Statement B is correct but statement A is incorrect
b. Statement A is correct but statement B is incorrect
c. Both statement are incorrect
d. Both statement are correct

10 . You defined a class called DataClass that has methods to connect to a SQL Server database and retrieve data. You find that the performance of the application has reduced due to non-termination of database connections after the application is terminated. You add the code for terminating the database connection in the Dispose() method in the parent class of Dataclass. However when the application is executed the problem persists. What else will you do to solve the problem
a. You need to explicitly invoke the Dispose() method
b. Instead of the Dispose method you need to used the Finalize() method and explicitly invoke the Finzalize() method
c. Instead of the Dispose method you need to use the Finalize() method and explicitly invoke the Finzalize() method
d. you need to used the Finalize() method along with the Dispose() method to terminate the database connection

11.Identify the error in the following lines of code
public Function dialogbox()
Dim FileDlg as New FileDialog()
FileDlg.showDialog()
End Function
a. The parenthesis after the FileDialog class is unnecessary
b. An instance of the FileDialog class cannot be declared inside a Function procedure
c. ShowDialog is not a member function of the FileDialog class
d. you cannot create an isnatance of the FileDialog class because it is an abstract class

12.What is the use of Windows Control Library Template
a. The Windows Control Library Template is used to create a control that can be added to the user interface
b. The Windows Control Library Template is used to create a windows application
c. The Windows Control Library Template is used to create a control that can be used in web application
d. The Windows Control Library Template is used to create an application that does to have a user interface

13.Statement A: Property procedure are used to access properties declared outside a class or structure
Statement B : Property procedures are of two type, Get Procedures and Set Procedures
a. Both Statements are incorrect
b. Statement A is incorrect and Statement B is correct
c. Statement A is correct and Statement B is incorrect
d. Both Statements are correct

14.Which component is used to transfer data between a dataset and the datasource
a. Data Adapter b. Data Reader c. Data Provider d. Data Command.

15.Which of the following statements is true about a module
a. A Module contains compiled code in intermediate language
b. A module contains security and permission required by the assembly
c. A module contains the type exposed by the assembly
d. A module contains the name and version number of the assembly

16.You have created a blank report. Now, you need to add a formula field to the report. Which task would you perform to ensure this?
a. Select Formula Fields in Fields explorer
b. Select Formula Fields in DatabaseFields explorer
c. Select Special Fields in Fields explorer
d. Select Database Fields in Fields explorer

17. which of the following statements is true about procedure overriding?
a. The overridden procedures need to have different data types.
b. The overridden procedures need to be declared in the derived class with the Overridable keyword.
c. The overridden procedures need to have different number of arguments.
d. The overridden procedures need to have the same arguments.

18. Statement A: An assembly stores information about the classes, structures, and interfaces.
Statement B: An assembly is contained within a namespace.
Evaluate the above statements.
a. Statement B is correct but statement A is incorrect.
b. Statement A is correct but statement B is incorrect.
c. Both statements are correct.
d. Both statements are incorrect.

19. Statement A: Both classes and structures have shared constructors.
Statement B: Both classes and structures can have variables that contain a reference to the data.
Evaluate the above statements.
a. Both statements are correct.
b. Statement B is correct but statement A is incorrect.
c. Both statements are incorrect.
d. Statement A is correct but statement B is incorrect.

20. Statement A: Property procedures are used to access properties declared outside a class or structure.
Statement B: Property procedures are of two types. Get procedures and Set procedures.
Evaluate the above statements.
a. Both statements are correct.
b. Statement A is correct and statement B is incorrect.
c. Both statements are incorrect.
d. Statement A is incorrect and statement B is correct.


25. To display data in a DataGrid control, you have created an OleDbConnection, OleDbDataAdapter, and a dataset. The name of the OleDbDataAdapter is OleDbDataAdapater1 and the name of the dataset is DataSet21. What is the next task that needs to be performed to display data?
a. Insert the following code in the Load event of the DataGrid control:
OleDbDataAdapter1.Fill(DataSet21)
b. Insert the following code in the Load event of the form :
DataGrid1.Fill(DataSet21)
c. Insert the following code in the Load event of the form :
OleDbDataAdapter1.Fill(DdataSet21)
a. Insert the following code in the Load event of the form :
OleDbDataAdapter1.Fill()


27. Which of the following statements is true for an assembly?
a. An assembly provides the functionality for security, debugging, and exception handling.
b. An assembly helps you to create logical groups of related classes and interfaces.
c. An assembly contains information about the implementation of classes, structures, and interfaces.
d. An assembly contains the declaration of properties, methods, and events.

29. Consider the following code snippet:
Class Validate_Cust
Sub Validate_Custname()
‘code to validate cust code
End Sub
End Class

Interface IOrderdetails
Inherits Validate_Cust
Property CustName() As String
Sub UpdataCustStatus()
Event Updata_Complete()
End Interface

Identify the eroor in the above code.
a. You cannot inherit an interface from a class.
b. You cannot declare events in an interface.
c. You cannot implement inheritance in interfaces.
d. You cannot declare properties within an interface.


30. Which of the following statememnts is NOT true about parameter arrays?
a. You can use more than one parameter array in a procedure.
b. The default value of a parameter array is an empty one-dimesional array.
c. The parameter array must be the last argument in the procedure definition.
d. Parameter array allows you to call a procedure with more arguments than that specified in the procedure declaration.

31. Which of the following is the correct sequence for creating a data adapter for implementing optimistic locking?
a. 1. Click the Advanced option of the Generate SQL Statements dialog box.
2. Select the use optimistic concurrency check box.
3. Associate a data adapter with the form.
4. Create the required SQL statement with the help of the query builder.
b. 1. Create the required SQL statement with the help of the query builder.
2. Click the Advanced option of the Generate SQL Statements dialog box.
3. Select the use optimistic concurrency check box.
4. Associate a data adapter with the form.
c. 1. Select the use optimistic concurrency check box.
2. Associate a data adapter with the form.
3. Create the required SQL statement with the help of the query builder.
4. Click the Advanced option of the Generate SQL Statements dialog box.
d. 1. Associate a data adapter with the form.
2. Create the required SQL statement with the help of the query builder.
3. Click the Advanced option of the Generate SQL Statements dialog box.
4. Select the use optimistic concurrency check box.

32. What is the function of the Update Command property of a data adapter?
a. It refers to a data command to insert data into a database.
b. It refers to a data command to update a database.
c. It refers to a data command to insert records from a database to a dataset.
d. It refers to a procedure to execute commands to retrieve data from a database.


33. Statement A: Crystal Reports support two methods, pull and push, to access data from a data source.
Statement B: in the push method, the database driver directly retrieves the data from the data source.
Evaluate the above statements.
a. Statement A is correct and statement B is incorrect.
b. Both statements are incorrect.
c. Statement A is incorrect and statement B is correct.
d. Both statements are correct.

34. Statement A: A DataGrid control can display data from records as well as multiple columns.
Statement B: A DdataGrid control cannot be bound to any dataset.
Evaluate the above statements.
a. Both statements are incorrect.
b. Statement A is correct but statement B is incorrect.
c. Both statements are correct.
d. Statement B is correct but statement A is incorrect.

35.Statement A: The .NET Framework consists of Web Forms, Windows Forms, and Console applications that pertain to the presentation layer of an application.
Statement B: Web Forms are used in Web-based applications, whereas Windows Forms are used in Windows-based application for providing an interactive user interface.
Evaluate the above statements.
a. Statement A is correct but statement B is incorrect.
b. Both statements are correct.
c. Statement B is correct but statement A is incorrect.
d. Both statements are incorrect.


36. Which of the following statements will you use to resize an array named girls so that it holds 20 elements?
a. ReDim girls=20 b. ReDim girls(20) c. Dim girls=20 d. Dim girls(20)


37. Which of the following is NOT a component of a data provider?
a. Command b. Dataset c. Data Adapter d. Connection


38. Which of the following option is a type of data adapter?
a. CommandDbDataAdapter b. ConnectionDbDataAdapter c. ClientDbDataAdapter
d. OleDbDataAdapter

39. Statement A: An assembly contains the information for deploying and maintaining version of an application.
Statement B: An assembly consists of manifest, module, and type.
Evaluate the above statements.
a. Both statements are incorrect.
b. Statement A is correct and statement B is incorrect.
c. Both statements are correct.
d. Statement A is incorrect and statement B is correct.


40. Which of the following code segments can be used to resize a three-dimensional array myarray(12,22,32)?
a. Redim preserve myarray(13,22,32) b. Redim preserve myarray(12,23,32)
c. Redim preserve myarray(12,20,31) d. Redim preserve myarray(12,22,31)
42. Statement A: To display a crystal report in the CrystalReportViewer control, it needs to be bound to the CrystalReportViewer control.
Statement B: You can use the ReportSource property of the CrystalReportViewer report to specify the source for accessing the crystal report.
Evaluate the above statements.
a. Both statements are correct.
b. Statement A is incorrect and statement B is correct.
c. Statement A is correct and statement B is incorrect.
d. Both statements are incorrect.

43. Which of the following statements is true about a structure declared with the Protected Friend keyword?
a. A structure declared with the Protected Friend keyword is accessible only from within its own class or derived class.
b. A structure declared with the Protected Friend keyword is accessible from within the program that contains its declaration and from anywhere else in the same assembly.
c. A structure declared with the Protected Friend keyword is accessible from within the same assembly and in the derived classes.
d. A structure declared with the Protected Friend keyword is accessible from anywhere within the application.

44 Which of the following components of the ADO.NET object model is used to connect to a database and retrieve data?
a. Data Reader b. Dataset c. Data adapter d. Data Provider

46. Statement A: The Report Designer displays various sections of a report, such as Report Header, Page Header, and Details.
Statement B: The Details section displays the report title.
Evaluate the above statements.
a. Statement A is incorrect and statement B is correct.
b. Both statements are correct.
c. Statement A is correct and statement B is incorrect.
d. Both statements are incorrect.

47. Consider the following code:
Sub Validate_Custname()
Interface Student
Sub mysub()
End Interface
End Sub
Identify the error in the above code?
a. The End Sub statement is missing in the given code.
b. A sub procedure cannot be declared inside an interface.
c. An interface cannot be declared inside a procedure.
d. The sub procedure declared inside an interface must be declared as private.

48. Consider the following code:
Interface Student
Sub Validate_Custname()
‘Code for validating student details
End Sub
End Interface
Identify the error in the above interface declaration?
a. The sub procedure should be declared as private
b. Interfaces should always be declared as Private.
c. The interface should be declared inside the sub procedure.
d. An interface can contain only the declaration of a sub procedure.

50. When does the ‘deactivate’ event occur in case of a Windows From?
a. When a user clicks anywhere on a Windows Form
b. When the mouse button is released
c. When a form is closed
d. When a form loses focus



52. Statement A: User interfaces are of two types, CUI and GUI.
Statement B: A CUI-based software allows you to interact with an application by entering commands.
Evaluate the above statements.
a. Both statements are correct.
b. Both statements are incorrect.
c. Statement A is incorrect and statement B is correct.
d. Statement A is correct and statement B is incorrect.

53. Which datatype will you use to store values between 0 and 65535?
a. Char b. Decimal c. Long d. Boolean


54. Statement A: The Report Header section of Report Designer contains the field titles of the report.
Statement B: The Page Header section of Report Designer contains the components that are displayed on each page of the report.
Evaluate the above statement.
a. Statement A is incorrect and statement B is correct.
b. Both statements are incorrect.
c. Both statements are correct.
d. Statement A is correct and statement B is incorrect.

55. Consider the following code segment:
Class Cls 1
Private name As String
Public Property EmpName() As String
Private Set(ByVal Value As String)
Name=Value
MsgBox(“The data is set”)
End Set
Private Get
Return name
End Get
End Property
End Class
Identify the error in the above code.
a. The property EmpName should be declared as Private because the Get and Set property procedures are declared as private.
b. The Get and Set property procedures should be declared as friend.
c. Access modifiers should not be used with the Get and Set keywords.
d. he Get and Set property procedures should be declared as public.


59. What will be the output of the following code?
Dim Str1 As String, Str2 As String
Str2 = “Students:”
Dim a As Integer
a = 40
Str1 = Str2 & a
a. Str1 will have a value Str2 & a
b. Str1 will have a value Students: & 40
c. Str1 will have a value Students: 40
d. Str1 will have a value Str2 & 40


61. Statement A: There are two types of datasets, typed and untyped.
Statement B: A typed dataset does not have any associated XML schema.
Evaluate the above statements.
a. Statement A is correct but statement B is incorrect. (it has associated xml schema)
b. Both statements are correct.
c. Statement B is correct but statement A is incorrect.
d. Both statements are incorrect.


63. Statement A: When the push model is used to access data from the data source, the developer writes the code to connect to the data source and retrieve data from it.
Statement B: While using the push model, you have fill the dataset before executing the application to view the crystal report.
Evaluate the above statements.
a. Both statements are incorrect.
b. Statement A is correct and statement B is incorrect.
c. Both statements are correct.
d. Statement A is incorrect and statement B is correct

64. Statement A: The Windows Forms Viewer can be inserted into a Windows application by double-clicking the control.
Statement B: The Windows Froms Viewer, present as a control in the Toolbox, is used to host the crystal report in a Windows Form.
Evaluate the above statements.
a. Both statements are incorrect.
b. Statement A is correct and statement B is incorrect.
c. Both statements are correct.
d. Statement A is incorrect and statement B is correct


66. You need to display the transaction details and the description for all products stored in the Sales Transaction table. The product details are stored in the Products table. Transaction details are stored in the Sale Transaction table. The product details must be displayed in text controls, while the transaction details must be displayed in a Data Grid control. Identify the correct sequence of steps that need to be performed to display product details in text box controls and the corresponding transaction details in a DataGrid control.
a. 1. Create a single connection.
2. Create a relationship between the two tables.
3. Create OleDbDataAdapter for the Sales Transaction table.
4. Create OleDbDataAdapter for the Products table.
5. Generate a single dataset for the two data adapters.
b. 1. Create a relationship between the two tables.
2. Create a single connection.
3. Create OleDbDataAdapter for the Sales Transaction table.
4. Create OleDbDataAdapter for the Products table.
5. Generate a single dataset for the two data adapters.
c. 1. Create a single connection.
2. Create OleDbDataAdapter for the Sales Transaction table.
3. Create OleDbDataAdapter for the Products table.
4. Generate a single dataset for the two data adapters.
5. Create a relationship between the two tables.
d. 1. Create a single connection.
2. Create OleDbDataAdapter for the Sales Transaction table.
3. Create a relationship between the two tables.
4. Create OleDbDataAdapter for the Products table.
5. Generate a single dataset for the two data adapters.


68. Which of the following is NOT a component of the ADO.NET object model?
a. Dataset b. Database c. Data Provider d. Data fields

69. Which of the following is NOT a benefit of using procedures?
a. When you debug a procedure, all other procedures in the application are also debugged.
b. When you use a procedure, your application is broken into logical units to improve readability.
c. When you use a procedure, any code can be reused in an application.
d. When you use a procedure, the process of debugging an application is simplified.

70. Which event of the Windows Forms Viewer is triggered when the control of the application execution passes to the Windows Forms Viewer?
a. GotFocus b. Load c. ReportRefresh d. Group TreeNavigate


73.Statement A: CLR provides the functionality, such as exception handling, security, and debugging.
Statement B: CLR can execute programs written in one predefined language only.
Evaluate the above statements.
a. Statement B is correct but statement A is incorrect.
b. Both statements are correct.
c. Statement A is correct but statement B is incorrect.
d. Both statements are incorrect.

Your Title