2).
Describe IDE components used in . net framework?
Ans:
1)
The start page – The start
page is the default homepage for browser provided within visual studio dot net IDE.It
allows to perform several tasks such as specifying your preferences.
2)
Windows form designer- It allows you to design user interface
for an application.It allows you to add controls to a form,arrange them as per
requirement and code to perform some action.
3)
Solution explorer window - This window lists the solution name ,project
name and all the forms and modules that are used in project.
4
Properties window - Properties window displays the
properties that are associated with an object.on selecting form1 from the
windows form designer the properties window lists all the properties associated
with forms such as size and text.
5) Toolbox-
Toolbox displays number of tabs .each tab contains several items.Toolbox
contains tabs ,data, components, windows forms ,clipboard ring and general.
6)
Output window- Output window displays message for status of
various features provided in visual studio dot net. It displays current status
and after compilation process is complete ,specifies number of errors that
occurred during compilation.
7)
Task list window- This displays a list of errors along with source (file & line no) of the error .It helps
you to identify & locate problems that are detected automatically as
edit or compile code.
8)
Server explorer window- It is handy tool for various
administrative tasks such as monitoring performance of other m/c on n/w & locating & connecting to various
servers on n/w.
9) Dynamic help window- This
window provides with context sensitive help .This window is constantly updated
to display links to help topics on current control ,component or keywords.
10) Class view window- This
window displays classes , methods ,& properties associated with a
particular file. They are displayed in a
hierarchical tree view depicting containership of these items.
11)
Code & text editor window-This window allows you to enter & edit code & text.This window is
called Code editor or text editor windows based on purpose for which use
it.Used this for to add code for form.
Q3)Explain
Compilation & execution process of a net application ?
Ans-
When we compile a program developed in a
language that targets CLR
instead of compling the source code into machine level code.The
compiler translates it into Microsoft intermediate language (MSIL) or
intermediate language (IL).no matter which language has been used to develop
the application .It always gets translated into intermediate language.
In
addition to translating the code into IL the compiler also produces metadata
about the program .During the process of compilation metadata contains the
distincton of the program such as the
classes,interfaces,the dependancies & the version of component used in the
program.
The
intermediate language & the
metadata linked an assembly.The compiler
creates .exe or .dll code & all the other relevant information from the
base class library is send to the class loader
loades the code in the memory.
Before the code execution the framework needs to convert the
intermediate language (IL) into native code or cpu specific code.
The just-in-time- compiler translates the
code from intermediate language (IL) into managed process of compilation.The
j-i-t compiler compiles for each supported cpu architecture.during the process
of compilation the (JIT)compiler
compiles only the code that is required during execution instead of compiling
the complete (IL) code.
When
uncompiled method is invoked during the execution the jit compiler
converts the (IL) for that method into native code .This
process saves the time & memory required to convert the complete IL into
native code.
During the jit compilation the
code is also checked for type safety. Type safety ensure that objects are always accessed in a compatible way.
For ex] Pass an 8 byte value to a method that
accepts 4 byte value as its parameter .The CLR will detect and trap such an
attempt.
After translating the IL into native code the
converted code is sent to the .net runtime manager.The .net
Runtime manager execute the code while executing
code a security check is performed to that code has appropriate permission for
accessing the available resources.
Q)Explain n-tier architecture?
1.
An
n-tier architecture uses business objects for handling business rules &
data access.
2.
It
has multiple server handling business services.
3.
This
application architecture provides various advantages over other types &
application architecture like
extensibility ,maintainability,and serializability of the application.
4.
This
architecture server organization specific requirement.
5.
All
web application handling multiple server share business objects follow n-tier
architecture.
Fig:- compilation and execution of .net
application.
4)
Describe advantages of .net framework?
Ans-1]
Consistent programming model:- .net framework provides a common object
oriented programming model across
languages . this object model can be used in code to perform several tasks such
as reading form & writing to files
,connecting to database & retrieving data.
2]Multi-platform application:-
There are several versions of windows most of which run on x86cpu.Some Versions such as windows CE & 64 bit windows run
on X86 cpu as well . A .net application can execute on any architecture that is
supported by CLR.
3]Multi-language
integration :-.net allows multiple language to be
integrated .ex-It is possible to create a class in c# that derives from a class
implemented in a vb.To enable object to interact with each other regardless of
language used to develop them a set of languages features has been defined in
common language specification (CLS).CLS includes basic languages features
regardless by many application CLS enhance language interoperability.
4]
Automatic resource management :-While creating an
application a programmer may be regardless to write code for managing resources
such as files,memory,n/w connection
& database & database resources.If a programmer does not free
these resources application may not execute properly. The CLR automatically
tracks resource usage & relieves a programmer of task of manual resource
management.
5]
Ease of deployment:- One of the goal of .net framework
is to simplify application deployment. Dot net application can be deployed
simply by copying files to target computer.Deployment of components has also been
simplified.microsoft component model (COM) has been used for creating
components.COM suffers from various problem relating to deployment.
5] Explain inheritance ,abstract class,sharing
attributes of oops in .net environment ?
Ans:-
1] Inheritance :-Inheritance is the
ability of a class to derive its characteristics from an existing class .Using
.net you can create a class that provides basic functionality so that other classes can inherit its
members.The derived classes can further override the inherited properties &
method to provide new functionality.vb.net provides inherits keyword to
implement inheritance.
Ex] class
derivedclass
Inherits parentclass
|
|
End class
2]Abstract
class:- Similar to other object oriented programming
languages. Vb.net enables you to create abstract classes that contain skeleton
of methods that are derived class can implement .the implementation code for
these method is written only in derived class .In vb.net abstract class create
using must inherit keyword.If derived class of an abstract class does not
implement one of the abstract methods of abstract base class it also must be
declared with must inherit keyword as it also become on abstract class.
Ex] public class form1
Inherits system windows .forms.form
Dim emp as new emp_details()
Private sub button1_click
Emp.annual_salary (textbox1.text)
End sub
End class
Public must inherit class employee details
Public must overrides sub annual_salary(by val m as
integer)
End class
Public class emp_details
Inherits employee details
Dim salary as integer=30000
Dim month as integer=6
Public overrides sub annual_salary (by val m as
integer)
Salary =salary*m
Msgbox(“total salary is” &salary)
Salary =30000
End sub
End class
3] sharing
attributes:-
--------------------------------------------****--------------------------------------------------
6) Describe
different types of dialog boxes used to build menu driven application?
Ans:-
1] color
dialog box:- To change background & foreground color
of text use default color dialog box.To
use default color dialog box add a color dialogcontrol to form or create an
instance of inherited color dialog class.
Ex] colordialog1.showdialog()
Textbox1.backcolor=colordialog1.color
Textbox2.forecolor=colordialog1.color
2]font
dialog:-this
dialog box is used for change font,font style,size of text.To use default
dialog box add font dialog control to form or instantiate font dialog class.
Ex]
fontdialog1.showdialog()
Textbox1.font =fontdialog1.font
3]Openfile
dialog class:- if wants to open a default open dialog box in
vb.net need to add an openfiledialog control to form or the instantiate the openfiledialog
class.
Ex] openfiledialog.showdialog()
4]Savefiledialog
class:- To
invoke default save as dialog box to overwrite on existing file or a create a
new file using vb.net add a savefiledialog class.
Ex] on button_click
Dim sfd as
new savefiledialog()
Sfd.showdialog()
5]Printdialog class:-To invoke default print dialog
box to print any text or graphic add a printdialogbox control and a print
document control to form or create an instance of printdialog &
printdocument class.
6]Pagesetup
dialog class:-To
invoke default pagesetup window add a pagesetupdialog to form or create an instance of
pagesetupdialog class.This is used for to set page details for printing.
Ex]public class form1
Dim pgsetting as new pagesetting ()
Private sub button_click
Pagesetupdialog1.pagesetting=pagesetting
Pagesetupdialog1. showdialog()
End
sub
End
class
--------------------------------------------------------------------***--------------------------------------------------------------------
7] Explain
different types of procedures used in .net ?
Ans :-
1 Sub
procedure.
2] Function
procedure.
3] Property procedure.
1] Sub procedure :- sub procedure is block of code enclosed
within sub & end sub
statement .Each time procedure is called
statement within the sub & end sub are executed. It starts with
first statement after sub & ends with first end sub, exit sub & return
statement. exit sub & return are used to
transfer control to calling code before end sub statement is
encountered. A sub procedure does not return a value it can take arguments such
as constants ,variables & expressions that are passed to it by calling
code.
Ex] private sub check (by val cust id as integer)
|
End sub
In sub procedure can be used are :-
1] Access modifiers like private, public, friend,
protected, protected ,friend
2]Arguments can
be declared for a procedure by specifying name & data type
3] Passing
arguments to a sub procedure either by val or by reference.
4]we can
call a sub procedure using procedure
name or by using call keyword.
2] Function procedure:- A procedure is a
block of code enclosed within function & end function. Each time a
function procedure is called statements within the function & end function
statement executed execution starts
with first function statement & end when the first function end function ,
exit function or return a function procedure
returns a value to the calling code. function procedure can define in modules
,structures, classes.
Ex] public function check_acc_status(by val acc as
integer ,by val amt as single)
|
Return amt
End function
In function process can be used as:-
a]access modifier be private,public,friend
,protected,protectedfriend.
b]A function procedure uses return statement to specify
return value.
c]public can be called by including its name &
arguments on right side of an assignment statement.
3]Property procedure :- A property procedure
is a set of code statements that are assigned or retrieve the values of properties declared within a module,class properties are types of
variables that store values of an object of a class. Properties can be accessed by public
or by using set & get property.Advantage of this procedure instead of public variables we can use read
only,write only or read /write type.There are two types of procedures :-
1]get procedures are used to retrieve values from a
property.
2]set procedures are used to assign values.
Ex]private name as string
Public property empname () as string
Set (by val value as string)
Name=value
Msgbox(“the data is set”)
End set
Get
Return name
End get
End propert
8] Explain ADO.NET object model?explain common
object ,dataadapter,dataset,dataprovider?
Ans:- ADO.NET object model:-
|






|
Accessing
retrieved data. Data
provider
|








In ADO.NET object model components are:-
1]Data provider:- A data provider is used for
connecting to database ,retrieving data,storing the data in a dataset,reading
,retrieved data ,updating the database.Their are two types of data providers:-
A] OLEDB data provider:-This type of data provider
works with all OLEDB providers such as SQL OLEDB provide oracle OLEDB provider,
Jet OLEDB provider.The OLEDB data provider classes are present in the system
data OLEDB namespace.
B]SQL server database provider :-This type of
provider is used to work specifically with Microsoft sql server. A SQL server
data provider is recommended for working with a Microsoft sql service data service.The sql server data provider classes are present in the
system.data.sqlclient.namespace.
2]Data adapter :- A data adapter retrieves data from
database into a dataset & updates the database when you make changes to dataset the changes
in database are actually done by data adapter .the data adapter first compares data in dataset with that
in database & then updates database.
There are 2 types of data adapter:-
A]sql data adapter:- this type of data adapter is
configured to access data speciality from Microsoft sql server.
B]OLEDB data adapter :-this is used to access data
from any database that is supported by OLEDB data provider.
A data adapter uses the connection objects OLEDB
connection & sql connection provided by data provider to communicate with
database.
3]Data
command :-A data command is a SQL statement or a stored
procedure that is used to retieve, insert, delete, modify data in a data source. A
data command is an object of SQL command or the OLEDB command class
. For retrieved data through data commands a connection object is created first
to connect to database where data
is to be retrieved command object is
created that refers to SQL statements.
Example]Dim cmd as sqlcommand=new sqlcommand
(“select * from customers”,con)
4]
Dataset:-Data is retrieved through dataset, since working
with data commands is very tedious &
a data reader only allows data to be retrieved in
read only & forward only mode data is connected. Cache set of records that are retrieved from
database.
When
connection is established the data adapter creates a dataset & store data
in it .The dataset acts like a virtual
database containing tables , rows & columns .An application works with
database records stored in dataset.
-------------------------------------------------------------***-----------------------------------------------------------------
9]Explain simple & complex data
binding?
Ans:-
1]
Simple data binding :-Simple data binding is process of
binding control such as textbox or label to a value in a
data set. The dataset value can be bound to control by using properties
of the control.
Ex]you can bind value of name column in dataset to a
textbox control by setting text property under data binding category of textbox control.
2]Complex data binding :-While simple
data binding involved binding a control to a dataset value complex data binding is process of binding component such as data
grid or a list box control to display multiple values for a column from dataset rows.
10
]Explain function of binding base manager?
Ans:-
For every data source that is bound to a windows
form control their exist a currency
manager object. The currency
manager object handles binding of data source by keeping a pointer to current
item in record list.

The currency manager class is derived from binding
manager base class .If all windows forms controls are bound to a single data
source the form will have one currency manager abject associated with it. A
binding context object which is windows form object is used to keep track of
existing currency manager objects in a form. A windows
Form containing bound controls has one binding
context object that keeps track of one or more currency manager object.
11]Explain pool & push model?
Ans:- A) PULL MODEL:-
|
|

When this model is used to access data from
data source the database driver directly retrieves the data from data source.
This model does not require the developer to write code for creating a
connection & retrieving data from
data source .The crystal report creates & manages sql commands for
connecting to data source& retrieving data from it.

|
|

|
B) PUSH MODEL:-
When this model is used to access data from
data source , developer write code to
connect to data source &
retrieve data from it. The data from data source is catched
in database & multiple crystal reports access data from data set. Thus push model allows
filtered data access by crystal report.
12]Explain stream reader , stream writer ,
binary reader ,binary writer & their methods?
Ans:- 1]
Stream reader & stream writer is
used to read & write a data a stream of characters.
This are
used the following methods:-
A]write() & write line():- This is used to
write data in a file.
B]Close():-It is used to close current stream
reader & underlining stream.
C]Flush():-It is used to force immediate
execution of all write() & write line() methods in a queue.
D]PEEK():- It is used to check for end of file
is reached or not.
2]binary
reader & binary writer :-This classes are used to read from & write to
binary files.
Binary reader class is used to
read string & elementary data types.
Ex]array, structure.
Binary writer class
is used for writing an elementary datatypes in a file using binary format.
The base stream property of binary reader is
used to underlining streams,interface with user access file.
Method is used
is:-
1)SEEK():-It is method of base stream class is
used to set file pointer to beginning of file.
It has 2 parameter & syntax is seek(offset
,seekorigin)
Offset:-offset is a no specify position
ie]relative to value of seek origin.
Seek origin:-seek origin sets seek reference
point in a stream so that offset from reference point can be reach out.
Seek origin has 3 types:-
BEGIN
END
CURRENT
13]Explain enumeration used in file stream class?
Ans:- File
stream has 3 types of enumerations:-
A]FILE MODE:-
1) append():-
It is used to open a file if it is exist & move file pointer at end
of file or create a new file .It can only use
with file access write().
2)create():-It is used to specify that OS should
create a new file but if it is already exist it will be overwritten.
3)createnew():-It is used to specify that Os create
a new file ie)file is already exist create new throw an exception.
4)open():-It is used to specify OS should open an
existing file.
5)open or create():- It is used to open file but if
it is not exist then create a new file
6)truncate():-It is used to specify that OS should
open an existing file after file is opened file should be truncated so that its
size is 0.
B]FILE
ACCESS:-
1)read():- It is used to specify read access to file
so that data can be read from file.
2)readwrite():-It is used to access a file so that
data can be written to & read from file.
3)write():-It is used to write data to file.
C]fileshare:-
1)none():- It is used to declining sharing of
current file when require to open a file will fail until the file is closed.
2)read():-It allows sharing of current file in read
mode.
3)write():- sharing of file in a read write mode.
It can be declared as :-
Imports system .io
Form_load()
Dim fstream as new file stream
(“c:\test.text”,filemode.open or create ,file access read write,fileshare.none)
14]Explain file handling hierarchy model of
system.io.namespace?
![]() |
|||
![]() |
1] File stream:-It provides an access to file &
file related functions .the path class within a file stream determines whether
filename extension is a part of path specified for file. File stream class open
a file in 2 ways:-
1)asynchronous mode.
2)synchronous mode.
1) every assembly is self describing through
metadata.
2)every reference to a type is scoped by an assembly
reference.
3).net can automatically locate referenced
assemblies.
Structure of an assembly:-
1)mainfest is descriptor of assembly.It
contains information are:-
The name &version of an assembly .its
interaction with other assemblies .the type exposed by assembly security
permission regarding by assembly.
2)module is either .exe or .dll. It contains:-
compiled code in intermediate languages
metadata associated with module optionally manifest for assembly.
16)Explain disconnected architecture in .net?
Ans:-
It is important features of ado.net. ado.net uses
the disconnected data architecture application connect to database only while
the retrieving& updating data.after data is retrieved the connection with
database is closed.
When database needs to be updated ;the connection is
reestablished working with application that do not follow a disconnected
architecture leads to a wastage of valuable system resources ,since application
connects to database & keeps the connection open until it stop running but
does not actually interact with database except while retrieving & updating
date.
In a disconnected architecture ,a database can enter
to needs of several applications simultaneously since interaction is for a
shorter duration.
The metadata contains description of the program
such classes ,interfaces,dependancies & versions of the components.
The intermediate language & the data are linked in assembly.
Compiler creates .exe & .dll file ,.exe &
.dll are executed information from base class library is sent to class loader.
JIT compiler
compiles only the code that is required
during execution instead of compiling complete IL code.
When the uncompiled method is generated during the
execution JIT converts complete IL code to native code.
During JIT compilation code is also checked for type
safety which ensures that objects are always accessed in a compatible way.
After that
native code is sent to the .net runtime manager.dot net runtime manager executes a code during this security check is
performed to ensure that the code has appropriate permission for accessing the
available resources.
Components of
.net ide:=












Features of clr:=
1)Automatic memory management.
2)standard type system.
3)language interoperability.
4)platform independent.
5)security management.
6) type safety.
Q)Explain
interface polymorphism?
Ans:=
Interfaces can act as specification for class members ,when you
implement an interface you also must implement all the specified members.
Polymorphism is tha ability to assume different
forms .polymorphism lets you assign objects of a derived class to variables of
the classes base class.
To implement polymorphism with interfaces you create
an interface & implement it in a number of classes.
You can then invoke the implemented method of the
various objects you create in the same way.
For ex]create an interface named animal interface
with one method ,breathe & implement that method in classes named animal
& fish.
Public class form1
Inherits system window.forms.form
Private sub
button2_click (by val sender as
system.object, by val e as system evevt args)
handles button2.click
Dim A as new
animal()
Dim f as new
fish()
Display(A)
Display(F)
End sub
Public sub
display(by val animal object as animal interface)
Animal object.breathe()
End sub
End class
Public interface
animal interface
Sub breathe()
End interface
Public class
animal implements animal interface
Sub breathe ()
implements animal interface.breathe
Msgbox(“breathing…..”)
End sub
End class
Q] What is
method overloading & when it is used?
Ans:= In OOP
method & properties can be overloaded ,which means you can define a method
or property multiple times with different argument lists.
Ex] you had a method named draw that can draw
rectangles & triangles.
For rectangles
you require 4 arguments & for triangles you require 6 arguments.
To handle this you can overload draw to handle 4 or
6 arguments just by defining the method twice with two different argument
lists.
Method overloading is used in situations where we
want to do same job but having different criteria.(Ie same function with different number of parameters)
Q] Explain
difference between arrays & collections ?
Ans:= ARRAY:=Array elements are initiated to default
values.
For numeric type default value is 0,
For Boolean =false
For char=char whose Unicode under is 0
For structure =an instance g structure type
enumeration types with all g it’s field set to its default value.
For enumeration types default values is an instance
of enumeration types with internal representation set to 0.
For reference
type default is nothing.
Array can be multidimensional, commas, separate the
dimensions of array.
Ie)dim a(5,10,15) as int again dim a() as string
={“first” , “second”,”third”}
Q) Explain encapsulation & why it is
important in OOP?
Ans :=
1) Binding of
data members & member functions together within an entity called as class
is known as encapsulation.
2)Encapsulation is all about the separation between
implementation & interface.
3) In other words,when you encapsulate an object you
make its code & data internal & no longer access to the outside except
through a well defined interface this is known as data hiding.
4) It is used in OOP because – the main principle of
OOP is data hiding ie) no outsider is allowed to change or modify data.
The data must remain hidden from the outside world.
Q) Describe in brief all .net IDE components?
Ans:= 1) The
start page :-Start page is what you
see when you first start visual
basic. you can use the start page to select from recent projects by default the
get started item is selected in the start page at upperleft. You can also
create a new project here by clicking the new project button. the start page
has other useful aspects as well
2) The
menu system:- The IDE menu system is very involved with many items to
choose from you done even see it all at once.
The menu system changes as you make selections in
the rest of IDE.
Their are hundreds of menu itens here,any many
useful ones that will quickly become favourite .
The menu system also allows you to switch from debug
to release modes ,lets you to configure the IDE etc.
3) Toolbars:- The toolbar feature is another handling
aspect of the IDE. These appear
Near the top of the IDE.toolbars provide a quick way
to select menu items & using the menu system ,theirs no doubt that toolbar
buttons can be quicker.
4) The new
project dialog box:- When you want to create a new project ,you turn to the
new project dialog box. -You can also set the name of the project & its
location for windows projects .The location is a folder on disk but for web
projects you specify a server running IIS.
-You can add projects to the current solution using
new project dialog box.
5)Graphical designers:- when you are working on a project that has user
interface elements such as forms,vb.net can display what those elements will
look like at run time & of course that’s what makes visual basic.
There are several different types of graphical
designers
Windows form designer.
Web form designer.
Component designers.
Xml designers.
6) Code designers :- Unlike graphical designers code designers let
you edit the code for a component.
- you can use
tabs at the top center of the IDE to switch between graphical designers.
-you can also switch between code & graphical
designers using designer &code menu items.
- 2 drop down lists boxes at the top of the code
designer the one on the left lets you select what object’s code you are working
with & the one on right lets you select the part of the code you ant to work
on.
7) Intel license :- One of the useful feature
of dot net code designers is Microsoft intel license. It is responsible for
those boxes that open as you write code ,listing all the possible options &
even completing your typing for you intel license is made up of number of
options.
List members - lists members of object.
Parameter info- list arguments of procedure calls.
Quick info:- displays information in tool tips as
the mouse rests on elements in your code.
Complete word:- complete typed words.
Automatic brace
matching:- add paranthesis.
8) The object browser:- this tool lets you
look at all the members of an object at once which is invaluable to prior info
the heart of objects you have added to your code.
To open the object browser select view /object
browser .the object browser shows all the objects in your program & gives you access to
whats going on in all of them.
9)The toolbox:- toolbox consists of tabs data ,components ,window forms, & general
tabs ,the tabs depend on type of project you are working on –even what type of
designer you are working with.
- The data , components, windows forms & general
tabs appear when you are working with windows forms in a window form designer
but when you switch to a code designer in the same project you will get a
general & clipboard ring.
- In short toolbox describes tools which are
required while designing a program.
10) Solution explorer:- This window gives you an overview of the
solution you are working with including all the projects in it & items in those
projects.
- This tool displays a hierarchy with the solution
at the top of hierarchy the projects one step down in the hierarchy & the items in each project as the next step
down.
-you can set the properties of various items in a
project by selecting it in the solution explorer & setting properties in
the properties window.
- If you are working with an object that has both a
user interface & code you can switch between graphical & code designers
by using buttons that appear at the top of the solution explorer when that
objects has been selected.
- solution explorer keeps the track of all items in
your projects to add new items you can see the menu items you can use the menu
items in the project menu.
- The solution explorer sees the things in terms of files
.their, the references folder holds the currently referenced items in a project
assembly information & file that holds the code for the form under
design.
11) The
property window:- you set the properties of various objects in vb to
customize them .
- The properties window is divided into 2 columns of
text with the properties on the left & their setting on right .The object
you are setting properties for appears in the drop down list box at the top of
the properties window & you can select from all available objects using
list box .to change a property setting you only have to click the right hand column next to the name of the
property & enter the new setting.
12)The dynamic help window:- the window that
shares the properties windows space
Is the dynamic help window.
-VB.NET includes the usual help menu with
contents,index & search items of course but now it also supports dynamic
help which looks things up for you automatically .
- you can see the dynamic help window by clicking
the dynamic help tab under the properties window.
-VB.NET looks up all kinds of help topics on the
element you have selected automatically.
13)
Component tray:- When you add components that are invisible at runtime they
will appear in a component tray which will appear automatically in the
designer.
14) The server explorer:- you use server
explorer to explore what is going on in the server & it is a great tool to
help make distinct servers feel less distinct because you can see everything
you need in an easy graphical environment . you can drag & drop whole items
into windows forms or web forms from the server explorer.
15) The output window:- if you look at the bottom of the IDE you will
see 2 tabs for the output & breakpoint windows.
Breakpoint window helps you manage breakpoints at
which program execution acts when you are debugging your code. The output
window gives you the results of building
& running program.
16) The task list :- As its name implies ,the
task list displays tasks that vb.net assumes you still have to take care
of & when you click a task the
corresponding location in a code designer appears .There are number of such
tasks for ex).VB.net has detected a syntax error underlined with a wavy line
,the error will appear in the task list . if
you have used a wizard where VB.NET still wants you to take care of
certain issues it will put a to do comment into the code.
17)The command window:- this window is a
little like the immediate window in VB6.0
Because you enter commands like file.add/new project
here & vb.net displays the add new project dialog box. however this window
is not exactly like the immediate window because you cant enter vb code &
have it executed.
Q) Describe
output window , local window,&
watch?
Ans:- Output window:- It displays messages for
the status of various features provided in vb.net IDE.
Ex) when you compile an application this window
displays the current status & after the compilation process is complete it
specifies the number of errors that occurred during compilation .if this window
is not visible you can open it by view->other window->o/p for processing ctrl+alt keys simultaneously.
Local window is a debugging tool that allows you to view
the values present in the variables
declared in the local procedures.
Watch window:- Sometimes errors
are difficult to identify & are not traceable to a single statement in such
situation you may need to observe the behaviour of a variable
Or an expression through out a procedure ,a form or a module in
VB.netallows you to do this by providing the watch window using watch window
you can change the values of variables or expressions in the break mode to see
how different values affect your code.
Q) Describe
different types of procedures in dot net?
Ans :- There are two type of procedures-
1) sub
procedure
2)functions
in .net
Procedures are made up of vb statements that ,when
called are executed. after the call is finished control returns to the
statement that are called the procedure .
In this way procedures make it simple for you to package
your code into discrete units
1)sub
procedures :-1) sub procedures don’t return a value.
2)sub procedure
is written in ‘sub proce-name()’ &
‘end sub’ keywords . whatever we want to write in it we write in between these
2 keywords.
Example:- module module 1
Sub main()
System.Console. writeline(“hello from vb.net”)
End sub
End module
-When this application starts control is transferred
to the main sub procedure automatically & the code in it runs.
- We can create our own procedure like above also
-you can also use call statement to call sub
procedure like ‘call sub procedure-name’.
-the argument to sub procedures can be passed by
values & by reference
2) FUNCTIONS:- functions return a value.
Function procedure starts with ‘function’ & ends
with ‘end function’ keywords.
Example) module module 1
Function add (by val int1 as integer , by val int2
as integer )as long
Return int1+ int2
End function
End module
You can return a value from a function using return
statement.
You can avoid using the return statement if you
simply assign a value to the name of function.
Ex)add =int1+int2
When you call a function by using its name & an
argument list enclosed in parenthesis that name is replaced by the value
returned by the function.
Q) Explain
different types of tab navigation & explain its use?
Ans:- -You
can use tabs at the top center of the IDE to switch between graphical designers
(such as the tabs form. VB [design] displays a graphical designer & form
.VB displays the corresponding code designer.
-You
can also switch between graphical & code designers using the designer &
code items in the view menu.
-Toolbox uses tabs to divide its contents into categories the tabs are
data , components , window forms & general the tabs available depend on the
type of project you are working on & even what type of designers you are working with.
-Tab
navigations provide an easy way to change from graphical designer to code
designer & vice versa.
Q) Explain
briefly reference type & value type?
Answer:-
you can pass arguments to procedure in
parenthesis given after the procedure
names.
These arguments
are of 2 types:-
1)value
type 2) reference type.
1) value
type:- consider a procedure
Module module 1
Sub main()
End sub
Sub disp (by val text as
string)
|
End sub
End module
-The keyword by
val indicates that argument to a procedure is passed by value.
-Here original
values are copied into local variables & are performed on local variable .
- The actual
variables doesn’t change ,only local variables change to display the result.
-This ‘value
type ‘ is default in vb.net.
-We can pass as
many arguments as we want to procedure of type value.
2) Reference
type:= consider a procedure below
Module module1
Sub main()
End sub
Sub disp (by ref text as
string)
|
End sub
End module
-The keyword by
ref indicates that arguments to a
procedure is passed by reference.
-When you pass a
variable by reference the location of the variable is passed to the procedure.
-Which means you
have direct access to that variable back in the calling code.
-The actual
value of that variable is changed.
Q) What is the scope of variable ?what are its
types?
Ans:- The scope
of an element in your code is all the code that you can refer to it without
qualifying its name.
In other words scope is its accessibility in
your code.
-As we write large
programs the scope is important because we will be dividing code into classes ,
modules , procedures & so on.
-In .net where
you declare an element determine its scope & an element can have scope at
one of the following levels:-
Block scope :- Available
within the code block in which it is declared.
Procedure scope:- Available
only within the procedure in which it is declared.
Module scope:- Available to
all code within the module , class or structure in which it is declared.
Namespace scope :- Available to
all code within that namespace.
Q) Explain
property ? describe how to create read only & write only properties ?which
is a difficult properties?
Ans:- -
properties are
used to set configuration data for objects such as text in text boxes or the width
of a list box.
Using properties
provide you with an interface to set or get the value of data internal to an
object.
You declare
properties using get & set procedures in a property statement.
Read only
property
:- Specifies that a properties value can be retrieved but it cant be modified.
Read only properties contain get blocks but no
set blocks .
Write only
property:-
specifies that a property can be set but its value can’t be retrieved.
-Write only
properties contains set blocks but no get blocks.
Ex) property is
created as follows :-
Module module1
Sub main()
End sub
End module
Module module2
Private val as
string
Public property
prop1()as string
Get
Return val
End get
Set ( by val
value as string)
Val=value
End set
End property
End module.
-MDI form is a
multiple document interface form .
-MDI form
closely resembles with a standard form with one major difference.
-The client area
of MDI form acts as a kit of corral for other forms.MDI form is also called as
MDI parent form can display MDI children in it.
- In forms and
MDI child windows are both based on standard system windows form.
-To make MDI
forms into MDI parents & children by setting the MDI container & MDI
parent properties .
No comments:
Post a Comment