October 20, 2018

Srikaanth

Luxoft Most Frequently Asked Latest VB.NET Interview Questions Answers

What Is Intermediate Language In .net ?

.net supports CLS i. e. Common language type. its a microsoft’s feature to bring all languages near one roof. When You compile .net code it doesn't converted into binary language, it converted into IL (Intermediate Language) also known as MSIL. And from IL to binary language converted at run time, CLR manages this process. At the runtime also it not converts whole project at time to binary, only converts that part which is going to execute, this the performance of project increases. This IL can use any language which is member of that .net studio. The assemblies (ExE, DLL) are also in IL form. So u can use any EXE or DLL created in vb.net in c#.net also.[which converts native code into byte code i.e machine understandable code.]

Is Vb.net Object Oriented? What Are The Inheritances Does Vb.net Support ?

yes VB.NET ia an object oriented.Vb.net supports all inheritance

1)single inheritance
It means Single class inheriting to single child classes
2)multiple inheritance
multiple classess inherits to single classes
3)Multilevel Inheritance
Single class inherits to one class that class inheritd to single another class
4)Heirarichal inheritance
Single class inherits to Multiple classes
5)Hybrid Inheritance

Single class inherits to different classess and that classes inherits to one class.

Difference Between Vb Dll And Assemblies In .net ?

Assemblies can contain DLL and EXE both. Different versions of one DLL can be handled by assemblies. They overcome the DLL Hell problem. Assemblies Contain Manifest and Meta Data files. These are the separate files that describes the Assembly and its attributes. VB DLL is inprocess.DLL run with an exe where as DLL are not self executable.
we can reuse DLLs .DLL are not platform independent If we have more then one Versions of a DLL we can face DLL Hell Problem.
Luxoft Most Frequently Asked Latest VB.NET Interview Questions Answers
Luxoft Most Frequently Asked Latest VB.NET Interview Questions Answers

What Is Dll Hell?

1.Adding of a new virtual method to a class exported from a DLL can cause the following problems
-If class already has a virtual method B and we are adding a new one named A before it, then we are changing the table of virtual methods. Now the first virtual method in the table will be A but not B and the client program which calls B will fail without recompilation as the call of B will cause the call of A and this is another method which possibly has other parameters and return type.
-When a class doesn?t have virtual methods and none of its base classes have, then adding of a new virtual method to it or to its base class will cause adding of the pointer for the table of virtual methods. This will cause change in the class size. So the error will occur after a client program will allocate memory for the class (an amount of memory that was required before the class has been changed) and will try to modify some of the class' fields explicitly or implicitly. In this case, as the pointer to the table of virtual method is added to the beginning of the class, all addresses of the class fields are shifted and thus we will get an abnormal client program behavior or a runtime error.
-In case when a class has virtual methods or any of its parent classes has, we can’t add virtual methods to classes exported from the DLL if they participate in the inheritance. We can?t add virtual methods not only to the beginning of the class declaration but also to the end of it. The problem is in shifting in the table of virtual methods. Note that even if you add a new virtual method to the end of the class declaration then the child’s virtual methods will be shifted.
2.Adding of a new field (of any kind) to a class declaration can cause following problems
1.Adding of a new field to the end of a class causes class size to change as in the case of adding of a virtual method to a class that didn?t have any. The client program will allocate less memory than it is required for a new class and this will cause referencing to the memory out of the class scope.
2.Adding of a new field between existing ones is even worse. It will case all addresses of fields after the new one to be shifted and a client application will work with the incorrect addresses while working with the fields that are situated after the new field. We also have the problem as in the previous point here.

How Does You Call And Execute A Sp In .net?

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()]

Why Datareader Is Useful?

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.]

Trace And Debug Belongs To Which Namespaces?

system.process.diagnostics.

What Is The Difference Between Clr & Cts?

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

What Is Clr?

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...

What Is The Root Namespace For All Types?

Imports system.

What Is The Relation Between Garbage Collector And Finalize And Destructor?

here the GC calls an object's FINALIZE method immediately before it collects an object that is no longer referred by the application.
GC doesn’t actually run finalize method when the GC finds a FINALIZE method it queues the obj up for the finalizer to execute the objects method[GC checks for those resources which are no longer used by the process. To release the memory from these resources and in order to regain the memory heap GC initiates destructors to destroy such instances of the program. Before the destructor void an instance variable finalize routine gets executed. This routine performs whatever is to be done before the object return to void state or prior to release of any unused resources.]

What Are The Similarities Between Class And Structure?

-> Both can have constructors, methods, properties , fields, constants , enumerations, events and event
handlers.
-> Structure and class can implement interface.
-> Both of them can have constructor without parameter and with parameter.
-> Both can have delegates and events.
[class is a collection of methods functions and properties enumerators and fields.
structure can be defined as a tool for handling a group of logically related data item.
the main difference is class is a referance type.structure is a reference value type.]

What Is The Difference Between Dataset And Recordset?

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.]

How Does You Get Record No From 5 To 15 From A Dataset Of 100 Records?

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

What Is The Difference Between Dataset And Datareader?

DataReader
Datareader is like a forward only recordset. It fetches one row at a time so very less Network Cost compare to DataSet(Fetches all the rows at a time). DataReader is readonly so we cannot do any transaction on them. DataReader will be the best choice where we need to show the data to the user which requires no transaction i.e reports. Due to DataReader is forward only we cannot fetch the data randomly. .NET Dataproviders optimizes the datareaders to handle the huge amount of data.

DataSet
DataSet is always a bulky object that requires lot of memory space compare to DataReader. We can say the dataset as a small database because it stores the schema and data in the application memory area. DataSet fetches all data from the datasource at a time to its memory area. So we can traverse through the object to get required data like querying database.The dataset maintains the relationships among the datatables insideit. We can manipulate the realational data as XML using dataset.We can do transactions (insert/update/delete) on them and finally the modifications can be updated to the actual database. This provides impressive flexibility to the application but with the cost of memory space. DataSet maintains the original data and the modified data seperately which requires more memory space. If the amount of data in the dataset is huge then it will reduce the applications performance dramatically.

How Do You Declare Static Variable And How It Is Declared And What Is Its Lifetime?

Static variables are declare through the Static Var1 as Integer The scop of the Var1 is within the module where its is Defined.

What Is The Difference Between Overriding And Overloading?

overloading-------having same method name with different signatures.
overriding--------methods name and signatures must be same
[OverLoading : All the method will share the same name but it differes based on the parameter, type of parameter and number of parameter
Overriding : The method in the derived class the has the same name in the base class and it changes the behaviour or functionality of the method in the base class.]

What Is Shadowing?

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.

What Is An Abstract Class?

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.

What Is The Difference Between Friend And Protected Friend?

Protected variable will be accessed in inherited class, but instance variable of class cant access protected variable.While friend variable will be accessed in inherited class as well as instance variable of class across the project.Where we need both functionality we are using protected friend scope.
[Protected --> Accessible ONLY by
1.Derived classes
2.Within the same class
Friend --> Accessible ONLY by
1.Derived classes
2.Classes in the same assembly
3.Within the same class
Protected Friend --> Accessible ONLY by
1.Derived classes
2.Classes in the same assembly
3.Within the same class]

Subscribe to get more Posts :