Untitled 1

what is delegates:the delegate is a pointer that allows the call of a function indirectly through its memory address.the delegate is used 2 call methods of other objects.it is similar 2 the function pointer used in other programming languages.the difference is that the delegate is a reference type on system.delegateclass. delegates R useful in situations where the occurrence of a specific event call different event handlers,depending on the context of the event occurrence.this requires dynamic association of events with event handlers,the delegates being used 4 this purpose. declaring an event with event specification leads 2 defining of an default delegate class called eventhandler inside the class that defined event.

  • creating delegate;
  • declaring the class thet contains the delegate method with the same signature (parameter list);
  • creating delegate instance & invoking the method associated with the delegate by calling the default method invoke

hash table: the hashtable class represents a collection of key-&-value pairs that R organized based on the hash code of the key.it uses the key 2 access the elements in the collection.a hashtable is used when U need 2 access elements by using key,& U can identify a useful key value.each item in the hashtable hs a key/value pair.the key is used 2 access the items in the collection.

property

description

count

gets the number of key-&-value pairs contained in the hashtable.

isfixedsize

gets a value indicating whether the hashtable hs a fixed size.

isreadonly

gets a value indicating whether the hashtable is read-only.

item

gets or sets the value associated with the specified key.

keys

gets an icollection containing the keys in the hashtable.

values

gets an icollection containing the values in the hashtable.

constructor: a constructor is a special type of subroutine called @ the creation of an object.a constructor method R invoked before an object of it’s associated class is created.if a class have a constructor,then the object of that class will be initialized automatically.a constructor looks like an instance method,but it different from a method because it never hs an explicit return-type,& can be overridden 2 provide custom initialization functionality.they have the task of initializing the object’s data members.if U combine a constructor that initializes an object 2 a valid state & property methods that only allow valid states,yur objects should remain in a valid state.in visual basic we create constructors by adding a sub procedure named new 2 a class.

destructor : the destructor is the last method run by a class.destructors in visual basic .net R implemented as a protected method named finalize.the garbage collector will call yur finalize method if U implement 1,but U 1’t know when that will be U can’t invoke this method directly.finalize method can not overloaded by convention but must be overridden if UR going 2 introduce yur own code in this routine by using overrides keyword in yur declaration.finalize method invoke automatically when the object is no longer required.the main work of the destructor is release resources & inform other objects that the current objects R going 2 be destroyed.

name space vb.net: namespace designates a collection of programming elements,organized & classed 4 grouping operations & easy access.@ the namespace level,the programming elements include:

  • classes of objects […];
  • structures […];
  • modules […];
  • interfaces […];
  • delegates […];
  • enumeration […];
  • other namespaces.

namespaces can be organized,aggregated into an assembly […].an assembly can contain multiple namespaces,which can contain other namespaces.
by default,the executable file created with visual studio environment contains a namespace with a name identical 2 that of project.more assemblies can use the same namespace.
explicit definition of a namespace is d1 in vb.net with specifications namespace & end namespace.it considers an application of type console application.it defines the namespace proiectnou that contains:

  • a namespace called formular1;
  • a class called grupop which contains 2 methods: adun & imp.

data set: the dataset is a complex & very powerful object that is actually an equivalent 2 “in-memory representation” of a database.it can contain datatables that correlate 2 database tables while datatables can contain a series of datacolumns that define the composition of each datarow.as U guess,the datarow correlates 2 a row in a database table.
in addition U can establish relationships between datatables within the dataset in the same way that a database hs relationships between tables.however,be aware that a raw dataset is weakly typed which is the biggest issue with it.

data table: datatable select. a datatable stores rows & columns.it is a container of other data.but it also provides search functionality.with the select method,we query a datatable 4 rows that match a condition.

data adapter:we’re passing this object 2 the variable called da.this variable will then hold a reference 2 the data adapter.while the 2nd line in the code above sets up a reference 2 the data adapter,the 3rd line creates a new data adapter object.U need 2 put 2 things in the round brackets of the object declaration: yur sql string (which we’ll get 2 shortly),& yur connection object.our connection object is stored in the variable which we’ve called con.(like all variable U can call it practically anything U like.we’ve g1 4 something short & memorable.) U then pass the new data adapter 2 yur variable (da 4 us):

data reader: datareader is a readonly,forward only & connected recordset from the database.in datareader,database connection is opened until the object is closed unlike dataset.using datareader we can able 2 access 1 row @ a time so there it is not required storing it in memory.in 1 datareader we can get more than 1 result set & access it 1 by 1.it will be faster 4 using simple purpose like populating the form.we should not use it 4 manipulating the records since it will always connect 2 database.

ado.net architecture: ado.net consist of a set of objects that expose data access services 2 the .net environment.it is a data access technology from microsoft .net framework ,which provides communication between relational & non relational systems through a common set of comp1nts system.data namespace is the core of ado.net & it contains classes used by all data providers.ado.net is designed 2 be easy 2 use,& visual studio provides several wizards & other features that U can use 2 generate ado.net data access code.the 2 key comp1nts of ado.net R data providers & dataset .the data provider classes R meant 2 work with different kinds of data sources.they R used 2 perform all data-management operations on specific databases.dataset class provides mechanisms 4 managing data when it is disconnected from the data source.

inheritance: jst like encapsulation & polymorphism,inheritance is an element of object-oriented programming by which we can derive the members of 1 class the “base class” 4 another class the “child class”. when we derive a class from a base class,the derived class will inherit all members of the base class except constructors.with the help of inheritance we can create an object that can reuse code. 1ce a method is defined in a super class,it is automatically inherited by all subclasses,they share a common set of properties. object-oriented programming allows classes 2 inherit commonly used state & behavior from other classes.by using inheritance we can reduce the testing & developing efforts. the behavior of the base class can be changed by writing code in the derived class.this technique is called overriding.with the new implementations of the derived class the inherited methods can also be overrided.inheritance allows U 2 build a hierarchy of related classes & 2 reuse functionality defined in existing classes.all classes created with visual basic R inheritable by default.in visual basic we use the inherits keyword 2 inherit 1 class from another.

overloading:in method overloading,multiple method having  the same name but different type of argument.sometimes our reqirement needs us 2 be able 2 create more function with same names this allows programer 2 provide easiness 2 the user by allowing user 2 use single name 4 different purposes.

4 example:

publicoverloadssub area(byval r)

publicoverloadssub area(byval length, byval width)

in the above example there R 2 method which hs the same name but use 4 different purpose 1 define the area of circle & other define the area of rectangle.both method have the different parameter.

overriding: a derived class inherits the properties & methods defined in its base class.this is useful because U can reuse these items when appropriate 4 the derived class.if the property or method in the base class is marked with the overridable keyword,U can define a new implementation 4 the member in the derived class.use the overrides keyword 2 shadow the member by redefining it in the derived class.this is useful when U cannot use the member “as is.”

in practice,overridden members R often used 2 implement polymorphism.4 more information,see polymorphism.

the following rules apply 2 overriding methods.

  • U can only override members that R marked with the overridable keyword in their base class.
  • by default,properties & methods R notoverridable.
  • overridden members must have the same arguments as the inherited members from the base class.
  • the new implementation of a member can call the original implementation in the parent class by specifying mybase before the method name.