Top 50 Vb.net Interview Questions You Must Prepare 19.Mar.2024

CLR is the common language runtime. which is the feature makes the .net applications to run plantform independent langauge interoperability.
CTS Common type system is the part of the CLR which enable the Common Datatype system to All the .net languages.it also defines conventions to convert objects from one langauge to another

Here are 5 objects in asp.net

  1. Response: This object is to response to other e.g.
  2. Request: This object is request from server.
  3. Application: This object is store global information of application.
  4. Session: This object used store the values into variable.
  5. Server.

for example:
while(datareader1.read())
while(datareader2.read())
end while
end while
this is not allowed even though both datareaders have two different sets of data.

Using command object we can execute a SP. Instead of sql query we have to pass the SP Name.
[command.connection =connectionstring
command.commandType=commandType.storedProcedure
command.commandtext="sp_name"
command.executenonquery()]

variable used to store the data
Read only variable:-
Read only variable means read only but not allow to write
constant:
constant variable specify the constant value.

The designer will likely through it away, most of the code inside lnitializeComponent is auto-generated.

Memory leak is a bug in the program which uses the memory continuously without releasing it until the system crash.Thread locking problem is nothing but a deadlock situation in case of synchronous process when two consecutive threads get lock on a common resource and waiting for each other to release that. This happens usually in case when the semaphores or monitors are not used.

Convert one variable type to another one is called datatype conversion we can also called this casting in VB.NET some automatically conversion is also there.
Cbool CByte CChar Cdate CDec CDbI Cmi CLng CObj CShort CSng CStr CType Asc.

Visual Studio .Net is basically a framework which makes easy development of codes written in Various programming languages.. It contains two things
1.Framework Class Library: It contains various classes managed within various namespaces.
2.Common Language Runtime: CLR is the execution engine which helps in compiling the IL code into machine code,takes care of security issues and many other critical tasks.Web pages, windows apps, console applications, Class libraries are various options which can be created using VS.net.

It is a class which contains at least one abstract method(A method without any implementation). Other methods can have implementations. This class can not be instantiated. It can always become a base class for other classes.

 

CLR means commaon language runtime for the dot net frame work.it is the frame work layer that resides above the operating system and handels/ manages the execution of the .net applications.our .net programs don't directly communicate with the operating system but through CLR.
OUT .NET APPLICATION--->>CLR--->WINDOWS OS

CLR means Common Language Runtime.It is Major component of the .NET frameworkIt provides number of benefits to the developers such as Exception handling,Security,Debugging and Versioning...

using CommonDialog class
eg:
the code to invoke the default font dialog box by using the FontDialog control is given below:
private sub displayfont_click(byval sender as system.object, byval e as system.eventargs) handles displayfont .click fontdialog. showDialog()
textbox1.font=fontdialog1.font
end sub
the code to invoke the default font dialog box by instantiating the fontdialog class is:
dim fdialog as new fontdialog()
private sub displayfont_click(byval sender as system.object,byval e as system.eventargs) handles displayfont. click fdialog. showDialog()
textbox1.font=fontdialog1.font
end sub

Some of the features present in VB 2005 are as follows: -
*Edit and continue: It allows developers to modify and execute applications almost simultaneously.
*Namespace: - This provides access to various parts of the NET framework and it also dynamically generates classes.
*Data source binding function is very useful for client server development.

PictureBox@Image = Image.FromFile(”C:olympicsO8_basketball .gif”)

Anonymous type is a feature of VB.NET and it allows data types to be created from the code which requires it. This feature is present in VB as well as C#. They should be stored in variables declared with the keyword VAR Dynamic typing is different and shouldn’t be confused with Anonymous type.

multidimentional array has same size in all dimentions but jagged is the type of multidimentional array which has different size for its dimensions.

int array[3][3][3]; //multidimentional array.
int array[3][1][6]; //jagged array.

A catch block that catches the exception of type System. Exception. You can also omit the parameter data type in this case and just write catch {}.

Based on Framework understanding and OOPS Concepts,Use of Different Component Library.

MSIL code is the Microsoft Intermediate Language. This is the code created by the CLR from the source code. This MSIL code is converted to machine/native code by JIT compiler. This machine code is actually the code which runs.

VB doesn't support multithreading.
[Its the fastest and an excellent application provided in VB.net. Due to which many operations can be done without any lapse of time. The system need not wait for an application or any task to get completed, rather it runs simultaneously.]

We can generate Crystal Report by using date parameter, but the date format should be "yyyy,mm,dd".
Ex.CrystaReport1.SelectionFormula = "{GLNOTE.L_DT}=date(" & a & ")"
The variable 'a' should be assign with formated date.

.NET has many new features and application supportive tools. To remove Microsoft visual basic name space all you have to do is to
1) Remove the import manually every time you start the project.
2) Creating a template which does not contain Microsoft Visual Basic namespace.
3) About new features and changes names you can refer to MSDN.

In VB to implement a disconnected recordset, after you have filled the recordset with the data, set its active connection property to “Nothing”. That breaks the connection to the database. You can locally also save the data of the recordset by using its Save function.

<asp:regularexpressionvalidator id="regExpDate"
runat="server"
ValidationExpression="^d{2}[/-]d{2}[/-]d{2,4}$"
ErrorMessage="It is not a valid date"
ControlToValidate="txtpatientvisitdate"
EnableClientScript="False"
Display="Dynamic"></asp:regularexpressionvalidator>

In VB MDI form is created by adding MDI Form to the project and adding child forms by setting MDICHILD property of the child form. In .NET there is no MDI form, any form can be made a MDI parent by setting IsMdiContainer property to TRUE.
Furthermore, there are changes in the properties, methods and basic behavior of the MDI Forms, like ability to set Background Color is not available in .NET, ability to add controls to MDI form(although they don't behave properly), ActiveForm to ActiveMdiChild, Arrange method to LayoutMdi, etc.

Ruby interface generator is primarily responsible for providing the visual part of the Visual basic and this was clubbed with “EB” designed for Omega database system. VBX interface was added to this feature which had the ability to load dynamic link libraries.

Jagged array is an array inside an array is called a jagged array.

A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
-A DataSet is designed to work without any continuing connection to the original data source.
-Data in a DataSet is bulk-loaded, rather than being loaded on demand.
-There's no concept of cursor types in a DataSet.
-DataSets have no current record pointer You can use For Each loops to move through the data.
-You can store many edits in a DataSet, and write them to the original data source in a single operation.
-Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
[1)With Data set you can retrive data from database like oracle and SQL Server and manage them in one dataset, with recordset this is not possible.
2)All representation of Dataset is using XML while recordset uses COM.
3)Recordset can not be transmitted on HTTP while Dataset can be.]

dispose(): should release all the resources that it owns.
close():closing the application
exit():Exiting from the loop
end():stops the execution of the page/function/procedure

Remove Handler myobj.myEvent, AddressOf MyEventHandler.

It is a collection of classes and services.It exists as a layer between.NET applications and underlying operating system.i.e., it encapsulates the basic functionality that was earlier built into programming languages such as debugging and security services.
[.net framework is a collection of services & classes.it exists as a layer b/w .net applications 7 the underlying operating system.
.net framework consists of web forms,window forms & console applications that pertain to the presentation layer of the aplication.
.net framework consists of two other components,the .net framework base classes & common language runtime(CLR).]

Visual Basic allows conversions of many data types to other data types. Data loss can occur when the value of one data type is converted to a data type with less precision or smaller capacity. A run-time error occurs if such a narrowing conversion fails. Option Strict ensures compile-time notification of these narrowing conversions so they can be avoided.
In addition to disallowing implicit narrowing conversions, Option Strict generates an error for late binding. An object is late bound when it is assigned to a variable that is declared to be of type Object.
Because Option Strict On provides strong typing, prevents unintended type conversions with data loss, disallows late binding, and improves performance, its use is strongly recommended.

Some of the features which are not present in VB are as follows they are: -
1) It supports unsafe code blocks for improved performance.
2) Partial interfaces and anonymous methods.
3) Multi line comments and static classes. Etc

When global and local varible in the same name.the local varibale in a mehod or function which use to override the global is called the shadowing.ie the Global varible is being shadowed by the local varible.

Option Strict On will restrict the implicit type casting (defalut is off in vb,net)

Console is used only for web application.

VB.NET is a windows application where as C# is a console.

dim dRow as data.datarow
for i as interger = 5 to 15
drow = dSet.Tables(0).Rows(i)
'process row
next i

Serilization: It is the process of maintaning object state in the form of a stream.
Deserilization: It is the process of reading the stream and construct the object.
Uses:(Remoting Concept)
1) making object state persistent
2) transmitting the object from one system to another system.

An XML fragment is an XML document with no single top-level root element To put it simple it is a part (fragment) of a well-formed xml document. (node) Where as a well- formed xml document must have only one root element.

Lisbox1.Items.Add "Prashant"
Lisbox1.Items.Add "Chinchu"
Lisbox1.Items.Add "Pallavi"
Lisbox1.Items.Add "Suresh"
Lisbox1.Items.Add "Polika"

Manifest and metadata are 2 parts of assembly architecture.
Manifest is used for storing AssemblyName, AssemblyTitle,publicKey.
Metadata contains Namespaces, Classes.

Data reader is useful when we just want to acccess datas from the database not when we want to perform DML operations. and It is useful when we want to perform forward only reading of datas.It wont requires any large volume of resources in the Front end. [Datareader is read only or forward only. So it is very fast to fetch the data from database.]

.NET is a Microsoft Framework and a software component. . NET has a large library of pre-coded solutions which provided developer significant help in developing applications with solutions already present. It offers reliable security and cross platform compatibility.

Xcopy technique is to simply copy your web application files to the production server hard drive and set a virtual directory there. The setting of a virtual directory is needed by several deployment schemes and can be achieved from Internet Information Manager Microsoft Management Consol.

It's always desirable to package your web applications such that they are easy to deploy on the production server then the traditional xcopy in which the developers have to use the command line.

@C# uses Must not Inherit, VB.Net uses sealed class
@C# uses Internal, VB.Net uses Friend
@VB.Net uses with events and end events
@C# uses abstract and VB.Net uses Must Inherit