VB.NET Flashcards
Disadvantages of vb ?
Following are the disadvantage of VB :
1. VB is not object oriented.
2. VB DLL does not support side-by-side execution
3. Deployment is time consuming as all the components must
be registered in the Windows registry.
[.The VB support OOP concepts, but not support fully.
2.VB does not support exception handling.
3.No multithreading mechanism.]
Advantage of vb.net over vb ?
1,supports Threading 2,powerful Exception handling mechanism 3,having support for the console based applications 4,More than one version of dll is supported [1. VB is object based while Vb.net is Object oriented 2. VB.net using OO functionality like inheritenc a, Excepetional handling, etc 3.VB .net is strong type casting which VB lack 4.VB.net supports multi threading....]
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.
How do you do multithreading application in VB ?
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.]
.what are the advantage in vb.net and different between vb and vb.net?
vb is not follow the oops concept. But vb.net follow the oops concept.
[Adv of VB.NET vb is object based.vb.net is object oriented vb use record set for database connection vb.net use dataset for database connection]
[1. VB uses vb runtime while vb.net uses CLR
2. VB object based,vb.net is object oriented
3. VB Suports splash screen
4. VB Uses on error goto while vb.net uses Try..
Catch..Finally
5. vb.Net Supports inheritance]
What is the Difference between Web User Control and Web Custom Control?
web user control where it predefined attribute functionality where it resides in control library web custom control: where it is defined by
user itself and store in a custom library
[Web User Controls:
1) Easy to Create
2) Limited support for consumers who use visual design tool
3) A seperate copy of the control is required in each
application.
4)Cannot be added to toolbox in Visual Studio.
5) Good for Static Layout
Web Custom Controls:
1) Harder to Create
2) Full support for consumers
3) Only a single copy of the control is required in the GAC
4)Can be added
5) Good for Dynamic Layout]
What is an indexed property?
you include the index parameter in the Property statement. In this example, the test_number parameter is the index for the Scores property. Public Class Student ' The private array of scores. Private m_Scores(9) As Integer ' The indexed Score property procedures. Public Property Score(ByVal test_number As Integer) As _ Integer Get Return m_Scores(test_number) End Get Set(ByVal Value As Integer) m_Scores(test_number) = Value End Set End Property End Class
What is versioning in .NET?
main advantage of .net is versioning and solve very critical problem.
.net maintain one application with more then one version and also solve DLL HELL problem because it can run same application with different version at a same time [.Net have an Assembly. It gives the Portable Execution file.The main use of assembly is to maintain the Dll and exe’s.
So sometimes the programmer confused to which is modified code.That time the assembly provide the Version.
That is called versioning.
It is start from 1.0.*,…….]
What is DLL hell?
1.Adding of a new virtual method to a class exported from a DLL can cause the following problems: o 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. o 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. o 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. 1.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 sqlquery 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.]
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
How do you declare static variable and how it is declared and what is its lifetime?
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]
In order to get assembly info whcih namespace we should import?
system.reflection
ColumnMapping belongs to which namespaces?
System.Data.Common
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…