LINQ Simplified

Anonymous Method , Lambda Expressions and LINQ in C# 3.0

LINQ stands for Language Integrated Query.

List contains flower name below  :

List flowerList = new List();

LINQ Lists – Anonymous Delegates

string flowerRose = flowerList.Find(delegate ( string flower ) )
return flower = “ROSE”;

LINQ Lists – Lambda Expressions

string roseFlower = flowerList.Find((string flower ) => flower.Equals(“ROSE”));

LINQ Lists – Linq Query

var flowerR = from string flower in flowerList
                    where flower == “ROSE”
                    select flower;

Javac , JVM , JRE , JDK

  • Javac , JVM , JRE , JDK

  • Javac  is Java compiler. This compiles Java code to byte code

  • JVM stands for Java Virtual Machine. This is a native application which runs byte code.

  • JRE stands for Java Runtime Environment. JRE contains both a JVM and class libraries. This is used to run byte code

  • JDK stands for Java Development Kit. JDK includes the JRE plus a compiler and other tools. This is required software to write and compile Java programs.

Java – Introduction

Java – Introduction

Java is a Object Oriented Programming language. Java was introduced in 1995 by Sun Microsystems .
Java is platform indepedent i.e Java Program can run on multiple operating systems .
Java can be converted to machince code. Machince code can run on JVM i.e Java Virtual Machine.
A JVM is a native application that interprets machine code. JVM is available in many platforms i,e Windows , UNIX , LINUX etc hence Java is platform independent language

Directories Unix Command

  1. cd – This command is used to change directory. Syntax : cd directory
  2. mkdir – This command is used to make or create new directory. Syntax : mkdir directory
  3. rmdir – This command is used to remove or delete directory. Syntax : rmdir directory
  4. pwd– This command is used to print working (current) directory. Syntax : pwd

File Manipulation UNIX commands

  1. cat – This is used to display file contents . Syntax  : cat filename
  2. cp – This command is used to copy file from a particular source to destination. Syntax : cp source destination
  3. mv – This command is used to move or rename files. Sysntax : mv oldname newname
  4. rm – This command is used to remove file. Syntax : rm filename
  5. pico – This command is used to create or modify file . Syntax : pico filename

Introduction to UNIX shell

Unix shell is command line interpreter. It processes one command or group of commands on command line when clicking Enter button.
There are several UNIX shell programs families. . The most important are the Bash shell, the Korn shell, and the TC shell. The shell families were developed for different purposes.

To create a UNIX script , use VI editor

Shell script begins with (#!) . #!/bin/ksh at the begining is used to invoke Korn Shell

Data Types in C#

Data Types in C#

C# basically has two data types:

  1. Value Type

  2. Reference Type     

All types are objects in the CTS and they are derived from System.Object.

Value type directly hold actual data. Value type is allocated to stack. Assignment of value type variable creates another copy of value.Value types include simple types like char, int, and float, enum types, and struct types.The scope of the variable is from the declaration till the end of the block in which it is declared

Declaration syntax of value type:

Datatype variable;

Ex: int intCount;

      int intRecordNumber = 10;

Reference type does not directly hold actual data. It contains reference to actual data. Reference type is allocated to heap. Assignment of reference type variable creates another copy of reference.Reference types include class types, interface types, delegate types, and array types.

Declaration syntax of reference type:

Datatype variablename = new Datatype();

C# & OOPs

C# & OOPs

What is a Class?

A class is a blueprint or prototype that defines the variables and the methods (functions) common to all objects of a certain kind.

What is an Object?

An object is a representative or specimen of a class. Software objects are often used to model real-world objects you find in everyday life.
For example :
OOPs Class & Object

Features of OOPs :

  1. Abstraction is the process of exposing the relevant things and hiding the irrelevant details. The easiest way to understand and appreciate this concept of handling complexity is by studying the example of Globe, a model/prototype of earth that is used by students to understand its geography. Globe provides only that information that is required and if too much of information is mentioned in it i.e. streets, lakes etc, it becomes too complex to comprehend. Hence Globe abstracts unwanted information and makes it easy to comprehend the complex earth.

  2. Encapsulation is the mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse. The data is not accessible to the outside world and only those functions that are wrapped in the class can access it. These functions provide the interface between the object’s data and the program. The insulation of the data from the direct access by the program is called data hiding.
    In OOP, code and data are merged into an object so that the user of an object can never peek inside the box. This is defined as encapsulation (Object is a capsule encapsulating data and behavior). All communication to it is through messages (function calls which we use to communicate to the object). Messages define the interface to the object. Everything an object can do is represented by its message interface. Therefore, we need not know anything about what is in the object when we use it.

  3. Inheritance is the process by which one class acquires the properties and functionalities of another class. This is important because it supports the concept of hierarchical classification.. Inheritance provides the idea of reusability of code and each sub class defines only those features that are unique to it.

  4. Polymorphism is a feature that allows one interface to be used for a general class of actions. An operation may exhibit different behavior in different instances. The behavior depends on the types of data used in the operation. It plays an important role in allowing objects having different internal structures to share the same external interface. Polymorphism is extensively used in implementing inheritance.
    add(int a, int b)
    add(int a, float b, int c)
    add(int a, int b, float c, double d)
    Here different datatypes are being added using the same interface.

Features of C#


•Simpler language

−Compared to earlier OO languages like C++, it is simple

−Designed considering the pitfalls of earlier languages


•Architecture Neutral / Portable


−Built -in security features like absence of pointers and confinement of the C# program within its runtime environment

•Support for Multithreading at language level

•Designed to handle Distributed applications

Structure of C# Program

using System;
class FirstProgram
public static void Main()
Console.WriteLine(“Hello World”);

•The extension of a C# program is cs

•There is no restriction on the filename unless it follows the naming convention of the OS

•Every statement in C# ends with ;

•Main is the starting point of execution of a C# program

•{ } describes a block of code

•Main function must be written inside the class

ASP.NET Tutorial : Getting started with ASP.NET

ASP.NET Tutorial : Getting started with ASP.NET

ASP.NET allows one to create dynamic web applications

We will create a simple Hello World program

Step 1: Open Microsoft Visual Studio 2008 using Start->Programs -> Microsoft Visual Studio 2008

Microsoft Visual Studio 2008
Microsoft Visual Studio 2008

Step 2 : Click on File -> New -> Website

Click on File -> New -> Website
Click on File -> New -> Website


Step 3: Select File System and Visual C# and enter project name “HelloWorld”

Select File System and Visual C# and enter project name
Select File System and Visual C# and enter project name

Step 4: Drag and Drop Label control from Toolbar to div tag and set Text Property to “Hello World”

Drag and Drop Label control from Toolbar to div tag and set Text Property
Drag and Drop Label control from Toolbar to div tag and set Text Property






Step 5: Click on Debug button to run Hello World web site