static void Main(string args)
Console.WriteLine("Enter the value:");
int x = Convert.ToInt32(Console.ReadLine());
for (int i = 1; i <= x; i++)
for (int j = 1; j <= x - i; j++)
for (int k = 1; k <= i; k++)
Metadata contains the information of types under the assembly like Namespaces,Classes and their members(only Signature),Structures and Interfaces etc. Type MetaData only describes about contents of an assembly, so an assembly can be called as self describing unit of execution as it describes about ifself to execution environment with help of its metadata.
Note : When we add reference of any assembly to VS, First VS will read the information of assembly from its type MetaData.
To Communicate with remote Databases Microsoft has designed ODBC drivers which facilitates the process of communication with Remote Databases.
OLEDB providers :
OleDB Stands for Object linking and embedding database)
These are designed purely for DataSource communication and more over a provider sits on the Server machine. So all the clients can use the provider to communicate with the datasource without installing them on client machine.
We can send a request to DataSource specifying the type of action. We want to perform using an SQL statements like select,insert,update and delete. We user commnad class for executing the statements. Constructors : command() Command(String sqlstmt, connection con) Properties of Command : Connection : Sets or Gets the current connection object associated with command. CommandTest : sets or gets the statement associated with command. Object of class command can be created as below Command cmd = new Command(); cmd.connection= <con>; cmd.CommandTest="<sql stmt>"; (or) Command cmd = new Command("<Sql stmt>",con) Methods of Command Class : ExecuteReader DataReader ExecuteScalar object ExecuteNonQuery int
Involves writing the executable code for an application in such a way that makes it cluture-neutral and language-neutral. While incorporating globalization, you must ensure that the culture-specific details are not hard-coded into the executable code. The primary task in this phase is to identify the various locale-sensitive resources and to isolate these resources from the executable code.
Involves the customization of an application for a specific locale. One major task in this phase is the translation of resources identified during the globalization phase. During this phase, various resources, such as images and text , for the designated locale are created.
vThe utmost basic entity in this scenario is Culture. The Culture information (usually called CultureInfo) includes the Language, Country/Region, Calender,Formats of Date, Currency,number System, and Sorting Order.This all information is defined inside CultureInfo Class, Which is inside the namespace System.Globalization.
vAccording to MSDN,The culture names follow a standard in the format “<languagecode>-<country>”, where <languagecode> is a lowercase two-letter code and <country> is an uppercase two-letter code.
vThe object raised from this class, when set true will be changing the culture of your application.But it’s never so that you make an application. In English culture,and raise an object of CultureInfo class for French language and automatically everything will start working for French.
vFor each cultures’ UI that is the text , images you want to see over the forms you will have to define the translations explicitly. This information is known as resources , and they exist in form of .resx files . These are xml files , and to read , write,manage them there are various classes listed under System.Resources namespace.
OLEDB Provider: (Object Linking and Embedded Database)
These are designed purely for data source communication and more over a provider sits on the server machine. So all the clients can use the provider to communicate with the data source without installing them on client machine.
Note: Both the Drivers and Providers suffers from a common drawback.i.e they were designed using native code languages. Because of this they were purely dependent on the O.S.
Because of the native language supports under visual basic language. VB was not able to communicate with drivers and providers directly. So it used some few intermediate component to communicate with drivers and Providers.
In this mode whenever a request comes from a client one object of remote class gets created and it’s reference is given to client, once the request is served immediately object gets destroyed without allowing him to make any other requests on that object, for a new request a new object gets created again and destroyed. Used in the development of single request application like “Railway PNR Status Enquiry”, “TM Machines” and “Examination Results”.
Note : This is very highly secured model used in application development.
As GAC contains multiple assemblies in it, to identity assemblies it will maintain a key value for every assembly known as public key token , which should be generated by us and associate with an assembly to make it strong named.
After serializing the data which has to be sent to the target machine it packages the data into packets this is what we call as marshalling,at this time it associates the IP Address of the target machine where the information has to be sent. UnMarshalling is in opposite to Marshalling which opens the packets of data for de-serializing.
2. IP-Address: Every system in a network is identified by using a unique id known as IP Address. It is a 4 par numeric value where each part will be ranging between 0-255. Eg: 0-255.0-255.0-255.0-255
vWe can mask IP Address of a system by specifying an alias name to it known as HostName. Systems under a network will be configured as following:
vTo exchange information between both the parties they make use of a process known as Serialization and De-Serialization . As applications represent the data in High Level(Object Format) Which are not free flowable , needs to be converted into low level(Binary or Text) and then transferred to the other system. Where on the target machine Low Level data has to be converted back into high Level.
vSerialization is a process of converting high level data to low level and De-Serialization is in opposite of serialization that converts low level data to high level.
vTo perform Serialization and De-Serialization remoting provides Formatter Classes, Those are:
Difference between Do While and Do Until is Do While executes the statements in Loop when condition is TRUE and exits from the loop when condition is FALSE.
But Do Until executes the statements in loop when condition is FALSE and exits from the loop when condition TRUE.
Do While :
Do While < Condition>
Inc/Dec of VAR
[ exit do]
Dim N as Integer =1
Do While N <=10
Out Put : 1 2 3 4 -------- 10
Do Until : Do Until< Condition>
Inc/Dec of VAR
[ exit do]
Dim N as Integer =1
Do Until N >10
When a procedure is created with N number of parameters then while calling the procedure you must pass N number of arguments . When we want to allow the user to call procedure with variable number of arguments and not fixed number of argument then C++ provides the concept Default arguments and similar to this vb.net provides Optional Parameters. To declare the parameters has Optional parameter use the keyword Optional. When a parameter is declared with the keyword optional then it compulsory initialize it. The value to which it is initialized is called as default argument. When we are not passing argument for the optional parameter then default argument will be take. A rule to declare optional parameter is they must be last parameter in the parameter list.
Example : The following example creates a function with the name sum with five parameters but allows the user to call the function sum with two or three or four or five arguments Module OptionalParameters Function Sum(Byval A as integer, Byval b as integer, OPtional Byval C as integer=0,OPtional Byval D as integer=0 , OPtional Byval E as integer=0) As integer Return A+B+C+D+E End Function Sub Main() Console.WriteLine(sum(10,20)) Console.WriteLine(sum(10,20,30)) Console.WriteLine(sum(10,20,33,44)) Console.WriteLine(sum(10,20,33,44,32)) End Sub End Module
To allow the user to pass any number of arguments of same data type to a parameter . We have to declare the parameter has an array. But when a parameter is declared as an Array then while calling the procedure, We must pass an array as argument and it is not possible to pass individual elements as arguments. To allow the user to pass an array of an argument or individual elements seperated with comma(,), we have to declare the parameter has ParamArray parameter. To declare the parameter as ParamArray parameter , We have to prefix the parameter declaration with the keyword ParamArray . ParamArray parameters have the following restriction.
A procedure can have only one ParamArray Parameter
ParamArray parameter must be last parameter in the parameter list.
ParamArray parameter cannot be optional parameter.
ParamArray parameter cannot be reference Parameter.
Example : The following example creates a Function with the name Sum that can accept any number of integers and returns their sum.
Function Sum( Byval ParamArray A() as integer) As Integer