VB.NET Flashcards

1
Q

Disadvantages of vb ?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Advantage of vb.net over vb ?

A
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....]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is intermediate language in .NET ?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Is VB.NET object oriented? What are the inheritances does VB.NET support ?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Difference between VB dll and assemblies in .NET ?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you do multithreading application in VB ?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

.what are the advantage in vb.net and different between vb and vb.net?

A

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]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the Difference between Web User Control and Web Custom Control?

A

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]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is an indexed property?

A
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is versioning in .NET?

A

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.*,…….]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is DLL hell?

A
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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does you call and execute a SP in .NET?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why Datareader is useful?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the difference between Dataset and Recordset?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does you get record no from 5 to 15 from a dataset of 100 records?

A
dim dRow as data.datarow
 for i as interger = 5 to 15
 drow = dSet.Tables(0).Rows(i)
 'process row
 next i
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you declare static variable and how it is declared and what is its lifetime?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is shadowing?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is an abstract class?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the DIfference between Friend and Protected Friend?

A
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]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

In order to get assembly info whcih namespace we should import?

A

system.reflection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

ColumnMapping belongs to which namespaces?

A

System.Data.Common

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Trace and Debug belongs to which namespaces?

A

system.process.diagnostics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the Difference between CLR & CTS?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is CLR?

A

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…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

what is the root namespace for all types?

A

Imports system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What is the relation between Garbage collector and finalize and destructor?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are the similarities between class and structure?

A
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.]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Do event have return type?

A

No. events do not have return type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What do you mean by .Net Framework?

A

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 aaplication.
.net framework consists of two other components,the .net framework base classes & common language runtime(CLR).]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Is there any easy way to convert VB6 programs to VB.Net?

A

Just Open The Vb Project in Visual Studio.Net(File—> Open)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is the Common Language Runtime?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What is VB.Net?

A

VB.NET has changed almost every aspect of Software development new concepts and techniques were intro the more imp thing is its a fully object oriented, new component techniques new visual tools for both local and internet interfaces.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

How is VB.Net different from VB6?

A

VB6 was interpreter based language while VB.NET is a compiled language
VB6 was not a type-safe language while VB.NET is a type safe language.
VB6 used ?On Error Goto? syntax to handle exceptions at runtime. VB.NET uses the Try? Catch? Finally syntax to handle exceptions at runtime.
VB.NET has much enhanced object oriented support than VB6
VB6 does not allow developing the multithreaded applications. In VB.NET you can create multithreaded applications.
VB6 was only considered good for desktop windows application. In VB.NET you can also develop web applications, distributed applications,
create .NET windows and web controls and components, write windows and web services.
In VB.NET, you can also use reflections to read the meta-data of types and using reflection emit you can also generate code to define
and invoke types at runtime.
VB.NET uses .NET framework class library along with specialized VB library (System.VisualBasic) as a standard library. As a result,
the standard library for VB.NET is much enhanced and useful compared to VB6 standard library.
VB.NET is platform independent because of .Net framework. Programs written in VB.NET can run on any platform where .Net framework is present.
The platform include both hardware and software (operating system) platforms.
VB6 uses COM (Component Object Model) as component architecture. VB.NET uses assemblies as its component architecture. The Assemblies
architecture has removed a lot of problems with COM including DLL-Hell and versioning problem.
? Components created in VB6 (COM) need to make and update registry entries. VB.NET does not require any registry entry making the deployment
easier.
VB6 used ASP to build web applications. VB.NET uses ASP.NET to build web applications.
VB6 used ADODB and record-sets to implement data access applications. VB.NET uses ADO.NET and datasets to build data access applications.
The ADO.NET also supports the disconnected data access.
[1.VB6 was a scripting language while VB.NET is a Programming language
2.VB6 was supported Unstructured error handling by using On Error Gotos tatement.VB.NET supports structured exceptional by using Try…Catch…
Finally to handle exceptions at runtime.
3.VB.NET is completely supports object oriented features. but VB6 wont support
4.VB6 used ADO as Data access technology and record-sets to implement data access applications. Also here data transfer in the form of binary format.
VB.NET uses ADO.NET and datasets to build data access applications. The ADO.NET also supports the disconnected data access. Here the data transfer
in the form of xml format. So here their is faster data transfer.
5.Multiple versions are supported with vb.net but with vb6 its not supported
6.multithreading is supported with vb.net, but not with vb6]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

what are Fixed memory leaks and threads locking problems?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

How to call a list box on the text if some one send me the code for it i understood the ?

A

like this what to do if we need to transfer the listbox items to the text if i am correct then my answer to this is double click on the listbox so that the eventof the listbox is displayed in the code editor

i. e private sub listbox1_selectedindexchanged……
textbox1. text=listbox1.selecteditem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What is the difference b/w Readonly Variable and Constant Variable?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

what is the dif b/w panel and groupbox?

A

Both panel and group box acts like a container to other controls they help us a lot in some applications where we want a group of controls or objects should be disabled or enabled when a specific task is performed the main difference isgroup box has a hording where u can place a
text of ure own whereas a panel is just like a frame what we used in VB but has a scrollbar(hs,vs)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

What do you mean by ‘Option Strict On’ ?

A

Option Strict
Visual Basic language in general does not require explicit syntax to be used when performing operations that might not be optimally efficient (e.g. late binding) or that might fail at run time (e.g. narrowing conversions). This permissive semantics often prevents detection of coding errors and also affects the performance of the application.
VB.NET enables a programmer to enforce strict semantics by setting this option to “On”. When used, this option should appear before any other code.
This option can be set to “On” or “Off”. If this statement is not specified, by default, it is set to “Off”.
Syntax: Option Strict [On / Off]
When it is set to “On”, it disallows any narrowing conversions to occur without an explicit cast operator, late binding and does not let the programmer omit “As” clause in the declaration statement. Since setting it to “On” requires explicit conversion, it also requires that the
compiler be able to determine the type of each variable. Thus it is implied that Option Strict also means Option Explicit.
Visual Basic .NET allows implicit conversions of any data type to any other data type. However, data loss can occur if the value of one data type
is converted to a data type with less precision or a smaller capacity. Setting this option to “On” ensures compile-time notification of these types
of conversions so they may be avoided.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

What are Jagged Arrays ?

A

a collection of discrete no of elements in each and every row is called as jagged arrays.
1)these jagged arrays doesn’t contain columns,
2)a jagged array also called as dynamic array
3)jagged array is a collection of dynamic arrays
4)these are faster and also save the memory.
syntax of jagged array:
int[][]x=new int [rows][]
here x is array name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

What are Satellite Assemblies?

A

Satellite assemblies are user for localizing the applications resources. A satellite assembly is a DLL that contains only resource strings .we typically have one satellite assembly DLL for each language. Because these satellite assembly DLLs are separated from the main assembly (an .exe or DLL), it is easier to drop in 48 multi-language support as we progress in your development process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

How can we remove Handlers at Run time ?

A

RemoveHandler myobj.myEvent, AddressOf MyEventHandler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

what is .net?

A

.Net is the Development Plateform which provides advanced feature facilities for the web and window application along with the window services.
The .Net is the Middle layer between the operating System and the .Net application .The feature of .Net that the .Net Component can talk with each other without worrying about the language in which they are originally.. Two main components are CLR stands for the common Language Runtime and the .Net FrameWork Base classes. The CLR performs the task of converting the IL to native code Which gives the .Net applications to be language Independent . The Other component Like .Net FramwWork Base Classes act as services to be provided to the .Net applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

Can any body tell me the code procedure for preparing parameterized cristel reports?

A

the report should be generated by taking to or more parameters.
example: report should be genarated FROM DATE to TODATE?
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

whats the difference bt. .dll extension and .exe extension files?

A

DLL : It is an inprocess server and runs in the same memory space as client application. Problem with dll is if any error comes in dll, whole application gets crashed.
Exe : It is an out of process server and rus as independent application in seperate memory. If error comes in exe, it does not affact the client application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

how can i extract the formated word(bold,italic,underline,font,color etc) from the msword file.?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

Differences between VB.Net and C#, related to OOPS concepts?

A
  1. C# uses Must not Inherit, VB.Net uses sealed class
  2. C# uses Internal, VB.Net uses Friend
  3. VB.Net uses with events and end events
  4. C# uses abstract and VB.Net uses Must Inherit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

Can u able to get the xml document in crystal report if yes how its possible?

A

Yes. You have to convert XML to dataset.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

What is different between Web.Config and Machine.Config and Where it will be ?

A

The ASP.NET Web.config file is used to define the configuration settings for an ASP.NET application. ASP.NET and the .NET Framework use .config files to define all configuration options. The .config files, including the ASP.NET Web.config file, are XML files.
The ASP.NET application configuration settings can be changed by creating a file called Web.config and saving it in the root folder of the application.This is how the minimal Web.config file should look like:
The first line of the Web.config file is the same as the first line for any .config file and specifies that this is an XML document with utf-8 character encoding type.There are 2 important characteristics of the Web.config file. The first one is that if you change your Web.config file, you don?t need to re-compile your ASP.NET application.
The second one is that the Web.config file cannot be viewed in directly in a browser.
Server-wide configuration settings for the .NET Framework are defined in a file called Machine.config. The settings in the Machine.config file can be changed and those settings affect all .NET applications on the server.what if the Machine.config file defines different settings than the ones defined in your Web.config file? The settings in the Web.config file override the settings in the Machine.config file.
[A web.config file is used to configure one asp .net web application. Each Asp.net application has a web.config file. A Machine.config file is used to configure the applications in a particular machine. Configuration done in machine.config file is affected on any application that runs on a particular machine. ]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

How to store and retrieve images in sql server database through VB.NET?

A

To store image in database 1st u need to make table like this
CREATE TABLE PicImage
(
Picid int,
Pic Image
)
Now in vb.net coding u have to write code like this
Dim ms As New MemoryStream
pic_photo.Image.Save(ms, pic_photo.Image.RawFormat)
arrImage = ms.GetBuffer
ms.Flush()Now pass arrImage in ur insert query.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

how to check for a particular record whether it is present or not in dataset ?

A
if the record is not present i want to display a message as no records what is the code for checking
 if you are using "DataReader" then 
if DataReaderName.HasRows then 
statements
else
statements
end if 
if you are using "DataSet" then 
if DataSetName.TABLES.("tablename").ROWS.COUNT=0 THEN 
statements.
end if
51
Q

I was asked in interview that if i have created a class and i don’t want the class to be inherited by any other members without me which key or function i have to use?

A
VB: for class NotInheritable [MyClass]
 For method: NotOverridable [MyMethod]
 C# For class or method :sealed[MyClassMyMethod]{}
52
Q

what is STA in .NET?

A

single-threaded apartments (the apartment model process) offers a message-based paradigm for dealing with multiple objects running concurrently.
It enables you to write more efficient code by allowing a thread, while it waits for some time-consuming operation to complete, to allow another thread to be executed.Each thread in a process that is initialized as an apartment model process, and that retrieves and dispatches window messages, is a single-threaded apartment thread. Each thread lives within its own apartment. Within an apartment, interface pointers can be passed without marshaling, and therefore, all objects in one single-threaded apartment thread communicate directly. A logical grouping of related objects that all execute on the same thread, and therefore must have synchronous execution, could live on the same single-threaded apartment thread.
However, an apartment model object cannot reside on more than one thread. Calls to objects in other processes must be made within the context of the owning process, so distributed COM switches threads for you automatically when you call on a proxy.

53
Q

How would you implement inheritance using VB.NET ?

A
Using VB.NET we can create a class that provides basic functionality so that other classes can inherit its members.
 VB.NET provides the 'Inherits' keyword to implement inheritance. By using the keyword 'Inherits' we can inherit the characteristics of a class into another class.
54
Q

What is assembly in .NET and What do you mean by protected class always present in the same assembly?

A

Assemblies are building blocks of framework. There are mainly two types of assemblies

a) Private Assembly
b) Shared Assembly

55
Q

what is the diff between VB MDI form and .net MDI form?

A

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.

56
Q

what is the advantage of option strict on?

A

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.

57
Q

What is MISL CODE?

A

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

58
Q

What is the difference between a “jagged array” and multidimensional array” ?
Can anyone show me it practically ?

A

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
What is Late Binding and Early Binding ?,
Late Binding: runtime binding
Early Binding: compile time binding as compilation is done before executing an application so it is called early binding.

59
Q

What is the exact defination of “Object”?

A

A real world entity which has some specific attributes related to its characteristics and operations or methods associated with its attributes.

60
Q

how do you use two datareaders at the same time in a vb.net windows application ?

A
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
61
Q

What are the difference between dispose(), close(), exit(), end()? When do we use them?

A

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

62
Q

When do we use imports.system.sqlclient and when imports.system.oledb?

A

System.Data.OleDB
It contains the objects that we use to connect to a data source via an OleDB provider , such as OleDbConnection, OleDBCOmmand System.Data.SqlClient
It contains objects that we use to connect to a data source via Tabular data stream interface provided by Microsoft Sql Server.
This can be generally used to provide better performance because it removes some of the intermediate layers required by the OleDB provider.

63
Q

What is the advantage of packaging over xcopy in .NET?

A

With the help of xcopy we solve the problem of DLL HELL and com dependencies
when we make xcopy of project all the dll, dependencies, assembly are updated automaticaly it’s a powerful feature of a .NET

64
Q

What is the difference between DataTable and DataSet?

A

Data table is a collection of record’s that consist the single table
Whenever dataset is collection of data table and it is provide interface between database and datatable 1 dataset consist multiple table.

65
Q

What is the significance of delegates. Where should they be used? what are the situations where we require them?

A
Delegates are used as pointer to hold the controls actually i used the delegates when there is problem in VB.Net 2005 where each control is already threaded, to use my personla thread on these control i used delegates
 Private Delegate Sub dd() 
Dim d1 As New dd(AddressOf c1)
Dim t1 As New Threading.Thread(AddressOf thread1)
public sub Thread1()
r1 = 
Me.Label1.BeginInvoke(d1) 
Me.Label1.EndInvoke(r1)
end sub
Public Sub c1()
Me.Label1.Text = ct1
Me.Label1.Refresh() 
End Sub
66
Q

What is the difference between manifest and metadata?

A

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

67
Q

What is the use of “MustInherit” keyword in VB.NET ?

A

If you want to create a abstract class in VB.NET it’s done by using “MustInherit” keyword.You can not create an object of a class which is marked as “MustInherit”. When you define “MustInherit” keyword for class you can only use the class by inheriting.

68
Q

How to find data with generics list in VB.NET (Write code).

A

In the code example below, the function “FindData” will return list(“sublist”) of the objects having matchingKey same as viewstate value.

Dim sublist As List(Of MyClass)
sublist = allClient.FindAll(AddressOf FindData) ‘sublist will contain objects matching specified matching condition

Function FindData(ByVal b As MyClass) _
       As Boolean
        If (b.matchingKey = CInt(ViewState("matchingKey "))) Then ‘matching condition
            Return True
        Else
            Return False
        End If
    End Function
69
Q

What is “fix” ?

A

Fix is a function available in VB, which returns integer part of the number.

70
Q

Difference between Fix and Int.

A

Both of them returns integer part of the provided number. Difference lies, how they deal with the negative numbers.
Fix returns the first negative integer greater than or equal to provided Number while Int returns the first negative integer less than or equal to provided Number.
For an example,
Int(-99.2) ‘ Returns -100.
Fix(-99.2) ‘ Returns -99.

71
Q

What is difference between Mid function and Mid Statement ?

A

Mid function returns the characters while the Mid statement replaces the characters.

72
Q

Which method is used to delete a file in VB.NET?

A

Kill(File name with path) :- This method deletes the said file/files from the disk. The name of the file
to be deleted is passed to this method as string type arguments. Files are simply deleted and not moved to recycle-bin. The use of wild card(* and /) is permitted in this function.

Kill(“C:\Files\abc.txt”) This will delete the file abc.txt locates in C:\Files\

Kill(“C:\Files*.txt”) This will delete all the files with .txt extension from C:\Files\

73
Q

What is the keyword used in VB to carry out the work of virtual keyword of C#?

A

The Overridable keyword. It declare a method to support polymorphism.

74
Q

Equivalent keyword of new in VB?

A

Shadow keyword is used to hide a method from a base class.`

75
Q

To define abstract class in VB which keyword is used?

A

MustOverride keyword is used to define an abstract method in VB.

76
Q

What is Optional Explicit in VB.net ?

A

When a variable is assigned with Option Explicit the variable must and should be declared .

Use Option Explicit to avoid incorrectly typing the name of an existing variable or to avoid confusion in code where the scope of the variable is not clear. If you do not use the Option Explicit statement, all undeclared variables are of Object type.

Usage :

Option Explicit On

77
Q

What is the Important aspect before using Objects in VB.Net .

A

Object creation should be made applicable to the absolute class where it is from and place exact path for it only then the objects will be working otherwise the objects will not loaded properly and the method wont work .

78
Q

What is the Syntax of get and set properties in VB.net?

A

The Syntax is :

Public Property MyExample As Integer
   ' Retrieves number.
   Get 
      Return number
   End Get
   ' Assigns to number.
   Set 
      number = value
   End Set
End Property
79
Q

What is the use of Option Infer statement in VB?

A

It is used in Visual Basic to determine the data type of a local variable declared without an as clause on the basis of the value assigned to the variable at

compile time.

(type inferencing in VB)

example: Option Infer on (default)
dim a=45
Take the mouse over variable a
a’s data type is integer( see in tooltip)

Option Infer off
Take the mouse over variable a
a’s data type is Object( see in tooltip)

a’s data type is object

80
Q

What is the difference between early binding and late binding in VB.NET ?

A

Calling a non-virtual method, at a compile time is known as early binding.
Calling a virtual method (Pure Polymorphism), at a runtime is known as late binding.

81
Q

What is the differences between dataset.clone and dataset.copy in VB.NET ?

A

Dataset.clone just copies the structure of dataset (including all the datatables, schemas, relations and constraints.); however it doesn’t copy the data.
Dataset.copy copies both the dataset structure and the data.

82
Q

What is portable executable in VB.NET?

A

A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.

83
Q

What is Side-by-Side Execution in VB.NET ?

A

The CLR allows any versions of the same-shared DLL (shared assembly) to execute at the same time, on the same system, and even in the same process. This concept is known as side-by-side execution.

84
Q

What is reflection in VB.NET ?

A

All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection.

85
Q

How to run a Dos command in Vb.net?

A

To run a DOS command in VB.NET, the following codeis used:

Shell(“cmd.exe /c c:\first.exe < in.txt > out.txt”)

86
Q

Write a program to implement the ++ Operator in VB.Net

A

value += 1
Return value
End Function

87
Q

What are the benefits of using Class Library?

A
Simple!. Why do we have public library? Because once a book is written, many people can subscribe to it, and re-use it again and again. Right?
 In the same way once you create your own class libraries which have multiple functions and procedures, they can be published for your own use, as well as others rewriting or performing copying of the code!
 There are other reasons too, but this is a great starting point to know why class library.
88
Q

What namespace does the Web page belong in the .NET Framework class hierarchy?

A

System.Web.UI.Page

89
Q

What is an Assembly?

A

Assembly are the basic buiding blocks of the .net framework.They are the logical grouping of the functionality in a physical file.

90
Q

What are the advantages of an assembly?

A

Increased performance. Better code management and encapsulation. It also introduces the n-tier concepts and business logic.

91
Q

What is Code Access Security?

A

CAS - Code Access Security is the part of the .NET security model that determines whether or not a piece of code is allowed to run, and what resources it can use when it is running.

92
Q

What are class access modifiers?

A
Access modifiers are keywords used to specify the declared accessibility of a member or a type. This section introduces the four access modifiers : ■Public
 ■Protected
 ■Internal
 ■Protected inertnal 
■Private
93
Q

What is tracing?

A

Tracing refers to collecting information about the application while it is running. You use tracing information to troubleshoot an application.

94
Q

What is serialization?

A

Serialization is the process of converting an object into a stream of bytes.
De-serialization is the opposite process of creating an object from a stream of bytes.
Serialization/De-serialization is mostly used to transport objects.

95
Q

What is Polymorphism?

A

Mean by more than one form. Ability to provide different implementation based on different number / type of parameters.

96
Q

What is an Interface?

A

An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body.

97
Q

What is the GAC? Gobal Assembly cache?

A

Each computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache. The global assembly cache stores assemblies that are to be shared by several applications on the computer. This area is typically the folder under windows or winnt in the machine.

98
Q

How does CAS work?

A

The CAS security policy revolves around two key concepts - code groups and permissions. Each .NET assembly is a member of a particular code group, and each code group is granted the permissions specified in a named permission set.

99
Q

What is static member?

A

The member defined as static which can be invoked directly from the class level, rather than from its instance.

100
Q

What is the purpose of XML Namespaces?

A

An XML Namespace is a collection of element types and attribute names. It consists of 2 parts ■The first part is the URI used to identify the namespace
■The second part is the element type or attribute name itself.

101
Q

What is the use of JIT ?

A

JIT (Just - In - Time) is a compiler which converts MSIL code to Native Code (ie. CPU-specific code that runs on the same computer architecture).

102
Q

Which method do you invoke on the DataAdapter control to load your generated dataset with data?

A

DataAdapter’s fill () method is used to fill load the data in dataset.

103
Q

What is the purpose of an Assembly?

A

An assembly controls many aspects of an application. The assembly handles versioning, type and class scope, security permissions, as well as other metadata including references to other assemblies and resources. The rules described in an assembly are enforced at runtime.

104
Q

What is Authentication and Authorization?

A

Authentication is the process of identifying users. Authentication is identifying/validating the user against the credentials (username and password).
Authorization performs after authentication. Authorization is the process of granting access to those users based on identity. Authorization allowing access of specific resource to user.

105
Q

What are the types of Authentication?

A

There are 3 types of Authentication.■Windows authentication
■Forms authentication
■Passport authentication.

106
Q

What is a Literal Control?

A

The Literal control is used to display text on a page. The text is programmable. This control does not let you apply styles to its content.

107
Q

What is Side-by-Side Execution?

A

The CLR allows any versions of the same-shared DLL (shared assembly) to execute at the same time, on the same system, and even in the same process. This concept is known as side-by-side execution.

108
Q

What are the different types of Caching?

A

There are three types of Caching : ■Output Caching
■Fragment Caching
■Data Caching.

109
Q

What is Reference type and value type?

A

Reference Type : Reference types are allocated on the managed CLR heap, just like object types. A data type that is stored as a reference to the value’s location. Reference types can be self-describing types, pointer types, or interface types.
Value Type : Value types are allocated on the stack just like primitive types in VBScript, VB6 and C/C++. Value types are not instantiated using new go out of scope when the function they are defined within returns.

110
Q

What is Delegates?

A

Delegates are a type-safe, object-oriented implementation of function pointers and are used in many situations where a component needs to call back to the component that is using it.

111
Q

What is sealed class?

A

Sealed classes are those classes which can not be inherited and thus any sealed class member can not be derived in any other class. A sealed class cannot also be an abstract class.

112
Q

How do you convert a string into an integer in .NET?

A

Int32.Parse(string)

Convert.ToInt32()

113
Q

What Is Boxing And Unboxing?

A

Boxing :
Boxing is an implicit conversion of a value type to the reference type.
Examples : Stuct Type, Enumeration Type
UnBoxing :
Unboxing is an explicit conversion from the reference to a value type.
Examples : Class , Interface.

114
Q

What is the use of ErrorProvider Control?

A

The ErrorProvider control is used to indicate invalid data on a data entry form.

115
Q

What keyword is used to accept a variable number of parameter in a method?

A

“params” keyword is used as to accept variable number of parameters.

116
Q

Why string are called Immutable data Type?

A

The memory representation of string is an Array of Characters, So on re-assigning the new array of Char is formed & the start address is changed . Thus keeping the Old string in Memory for Garbage Collector to be disposed.

117
Q

What is the difference between Convert.toString and .toString() method?

A

Convert.toString handles null while i.tostring() does not handles null.

118
Q

What is a DataTable?

A

A DataTable is a class in .NET Framework and in simple words a DataTable object represents a table from a database.

119
Q

What is a DataSet?

A

A DataSet is an in memory representation of data loaded from any data source

120
Q

What is the difference between in-proc and out-of-proc?

A

An Inproc is one which runs in the same process area as that of the client giving tha advantage of speed but the disadvantage of stability becoz if it crashes it takes the client application also with it.
Outproc is one which works outside the clients memory thus giving stability to the client, but we have to compromise a bit on speed.

121
Q

What is the differnce between Managed code and unmanaged code?

A

Managed Code: Code that runs under a “contract of cooperation” with the common language runtime. Managed code must supply the metadata necessary for the runtimeto provide services such as memory management, cross-language integration, code access security, and automatic lifetime control of objects. All code based on Microsoft intermediate language (MSIL) executes as managed code.
Un-Managed Code:Code that is created without regard for the conventions and requirements of the common language runtime. Unmanaged code executes in the common language runtime environment with minimal services (for example, no garbage collection, limited debugging, and so on).

122
Q

What are the advantages of VB.NET?

A

The main advantages of .net are : ■.NET is a language independent
■Automatic memory management(garbage collection)
■Disconnected architecture
■Object Oriented.

123
Q

What is strong-typing versus weak-typing?

A

Strong type is checking at the variables in compile time.

Weak typing is checking the variables at run-time.

124
Q

What is the maximum size of the textbox?

A

65536