NET has complete support for object-oriented concepts. It is also possible to run VB. NET programs on Mono, the open-source alternative to. So you have finally found your dream job in VB. NET but are wondering how to crack the VB. NET Interview Questions. Every interview is different and the scope of a job is different too. Keeping this in mind we have designed the most common VB.
NET Interview Questions and answers to help you get success in your interview. Below is the list of Top VB. NET Interview Questions that are asked in an interview. These top questions are divided into two parts which are as follows:.
In VB. Net Optional Parameters are accepted, not case sensitive, nothing is used to release unmanaged resources, support of both structured and unstructured error handling. Net is Platform Independent, VB. Practically, it is used to analyzed data of database can be used for some other purpose also. A namespace is an organized way of representing Class, Structures, and interfaces present in the.
NET language. Current Affairs Quiz May Current Affairs Quiz April Current Affairs Quiz March Current Affairs Quiz February Current Affairs Quiz January Current Affairs Quiz December Andhra Pradesh Current Affairs. Arunachal Pradesh Current Affairs. Assam Current Affairs. Bihar Current Affairs.
Chhattisgarh Current Affairs. Delhi Current Affairs. Goa Current Affairs. Gujarat Current Affairs. Haryana Current Affairs. Himachal Pradesh Current Affairs. Jharkhand Current Affairs.
Karnataka Current Affairs. Kerala Current Affairs. Madhya Pradesh Current Affairs. A single instance of an out of process component can service many clients. In-process components are used by applications or other in-process components. The client is usually an application running in another process. The code running in an ActiveX Exe is running in a separate process space.
You would usually use this in N-Tier programming. Explain single thread and multithread thread apartments? A single-threaded component has only one apartment, which contains all the objects the component provides. This means that a single-threaded DLL created with Visual Basic is safe to use with a multithreaded client.
Calls from all client threads except one are marshaled, just as if they were out-of-process calls. What is a Component? If you compile an ActiveX dll, it becomes a component. If you compile an ActiveX Control, it becomes both a component and a control. Which is better? Early binding uses type library information at design time to reference procedures, while late binding handles this at run time.
Late binding handles this by interrogating the reference before each call to insure that it supports a particular method. Since every call to a late bound object actually requires two calls.
Except where early binding is not supported ASP, scripting, etc. This is not the case. The type declaration of the object variable determines whether it is late or early bound, as in the following:.
What are the Advantages of disconnected recordsets? A disconnected Recordset, as its name implies, is a Recordset that lacks a connection. It can save you time and effort and make your code more scalable. In order to create a disconnected Recordset two Recordset properties must be set appropriately.
VB automatically assigns batch optimistic locking to newly created, connectionless recordsets. To create one of these structures, then, the only thing you need do is create the object variable instance. After that, you can simply begin adding fields to the construct. This method requires two parameters , the field name and the field data type. Additional, optional Append method parameters include DefinedSize and Attrib.
The DefinedSize argument takes the size of the field. Fill the Attrib parameter with constants that define additional field characteristics, such as whether it will allow null values or is updatable. Disconnected Recordsets, first available with ADO 2. They are call disconnected because the connection to the database is closed. The collections, properties, and methods of a disconnected Recordset are still available even though the connection is closed. This frees up server resources, given that the number of open connections is limited and database locking is a non-issue.
What are Benefits of wrapping database calls into MTS transactions? If database calls are made within the context of a transaction, aborting the transaction will undo and changes that occur within that transaction. This removes the possibility of stranded, or partial data. Database connections are put to? As opposed to being created and destroyed and are activated upon request. How to register a component? Controls which do not have events?
Shape and line controls are useful for drawing graphical elements on the surface of a form. The image, shape and line controls are considered to be lightweight controls; that is, they support only a subset of the properties, methods, and events found in the picture box. Because of this, they typically require less system resources and load faster than the picture box control. What are the Control Categories?
These controls are contained inside the Visual Basic. Intrinsic controls are always included in the toolbox. These include controls that are available in all editions of Visual Basic DataCombo, DataList controls, and so on and those that are available only in the Professional and Enterprise editions such as Listview, Toolbar, Animation, and Tabbed Dialog.
Many third-party ActiveX controls are also available. Since these can be added to the toolbox, they can be considered controls.
What is the difference between Image and Picture box controls? The sizing behavior of the image control differs from that of the picture box. It has a Stretch property while the picture box has an AutoSize property. Setting the AutoSize property to True causes a picture box to resize to the dimensions of the picture; setting it to False causes the picture to be cropped only a portion of the picture is visible. When set to False the default , the Stretch property of the image control causes it to resize to the dimensions of the picture.
Setting the Stretch property to True causes the picture to resize to the size of the image control, which may cause the picture to appear distorted. What is the Default property of datacontrol? Define the scope of Public, Private, Friend procedures?
The set of public variables, methods, properties, and events described in a class module define the interface for an object. Additionally, constants user-defined types, and Declare statements within a class module must always be private. The Friend keyword makes a procedure private to the project: The procedure is available to any code running within the project, but it is not available to a referencing project. This allows MTS to reuse database connections.
Object pooling is an important design concept required for high-performance applications. A performance optimization based on using collections of preallocated resources, such as objects or database connections.
Pooling results in more efficient resource allocation. What is the Difference between a function and a subroutine? A function accepts any number of parameters possibly zero , does something with them, and returns a value. There are two differences between a function and a subroutine: A How they are invoked. B How they are accessed. A function call has the following syntax :: function arg1, arg2, … where: function Is the name of the function. In addition, on some platforms, the functions are available immediately; whereas, the subroutines are available in a special subroutine library that you must access.
Embedding objects - When you embed an object, a copy of the object is inserted into the destination document. When you change information in the source document, no changes will be reflected in the destination document. The actual data for the object is stored within the destination file. To make changes to the embedded object, double click it and it will launch the original application the source file was in. Linking objects - Information is updated when you modify the original source file when you use a linked object.
This dynamic updating is very handy for things such as the aforementioned monthly report. You can open up the Excel spreadsheet that is referenced within your Word document. Make changes to the spreadsheet, close Excel, and when you open your Word document… viola!
The changes are already there. If that object is linked to ten other Word files, the changes are already in those ten files, too! What is the Difference between listbox and combo box?
If the number of items exceeds the number that can be displayed, a scroll bar is automatically added to the ListBox control. This control allows the user to select an item either by typing text into the combo box, or by selecting it from the list. DIFF::Generally, a combo box is appropriate when there is a list of suggested choices, and a list box is appropriate when you want to limit input to what is on the list.
A combo box contains an edit field, so choices not on the list can be typed in this field. What is the Difference between Dynaset and Snapshot? All Recordset objects are constructed using records rows and fields columns. There are five types of Recordset objects:. Table-type Recordset: representation in code of a base table that you can use to add, change, or delete records from a single database table Microsoft Jet workspaces only. Dynaset-type Recordset: the result of a query that can have updatable records.
A dynaset-type Recordset object is a dynamic set of records that you can use to add, change, or delete records from an underlying database table or tables. A dynaset-type Recordset object can contain fields from one or more tables in a database.
This type corresponds to an ODBC keyset cursor. Snapshot-type Recordset: a static copy of a set of records that you can use to find data or generate reports. This type corresponds to an ODBC static cursor. Forward-only-type Recordset: identical to a snapshot except that no cursor is provided.
You can only scroll forward through records. This improves performance in situations where you only need to make a single pass through a result set. This type corresponds to an ODBC forward-only cursor. Dynamic-type Recordset: a query result set from one or more base tables in which you can add, change, or delete records from a row-returning query.
Further, records other users add, delete, or edit in the base tables also appear in your Recordset. What is the Difference Listindex and Tab index? Not available at design time. Visual Basic automatically renumbers the TabIndex of other controls to reflect insertions and deletions. You can make changes atdesign time using theProperties window or atrun time in code.
One may use a Select Case block within an If block. Select Case choices are determined by the value of an expression called a selector. Items in the value list must evaluate to a literal of the same type as the selector A.
A single Case statement can contain multiple values. You can specify a range of values in a Case clause by using the To keyword. A variable declared inside a Select Case block cannot be referred to by code outside of the block. Suppose that the selector in a Select Case block is the string variable myVar. Which of the following is NOT a valid Case clause? Case myVar. Substring 0, 1 D.
Length Ans: D. Colon D. Which Case clause will be true Find whenever the value of the selector in a Select Case block is between 1 and 5 or is 8?
Case 1 To 5; 8 Ans: B. Which Case clause will be true Find whenever the value of the selector in a Select Case block is greater than or equal to 7? Find what type of items are valid for use in the value list of a Case clause? Find what happens to a variable declared locally inside a Sub procedure after the procedure terminates?
It maintains its value even after the End Sub statement executes. It ceases to exist after the End Sub statement executes. It loses its value temporarily after the End Sub statement executes, but regains that value upon re-entry to the Sub procedure. It is reset to its default value. Suppose a variable is passed by reference to a parameter of a Sub procedure, and the parameter has its value changed inside the Sub procedure. Find what will the value of the variable be after the Sub procedure has executed?
It will have the newly modified value from inside the Sub procedure. It will retain the value it had before the call to the Sub procedure D.
Suppose a variable is passed by value to a parameter of a Sub procedure, and the parameter has its value changed inside the Sub procedure. Find what will be the output of the following program Find when the button is clicked?
Suppose the variable myName is declared in a Dim statement in two different Sub procedures. Which statement is true? The program will malfunction Find when it is executed.
Find when the value of myName is changed in one Sub procedure, it will also be changed in the other Sub procedure. The two variables will be local to their respective Sub procedures. Ans: D. Which of the following statements is guaranteed to pass the variable number by value to the Sub procedure Tally? Tally numVar B. Tally ByVal numVar C. Tally numVar D. Call Statements B. Which of the following is NOT a reason for using procedures? They break a complex problem down into smaller pieces.
They make a program run faster.
0コメント