Chapter 1 Basic C# Introduction
C# is a very powerful language yet it has only 90 or so keywords. According to Microsoft it is easy to learn specially for people with background in C, C++, and Java. It has all the bells and whistles that you expect from a modern language.As this is an object oriented language therefore it supports encapsulation,polymorphism and inheritance........
Chapter 2 Introduction to Visual Studio IDE(for C#)
The development environment provided by Microsoft for C# is one of the best IDE if not the best. This product is a trend setter and all other IDE's try to copy its features. It is so rich in feature that it is hard to enumerate each and every little tricks it has. To understand this environment you have to do it yourself. Best part of the IDE is user can change it and customize it according to his/her needs. .....
Chapter 3 Your First C# Program
Now lets start writing our first C# program. You will see that C# can create many different kind of programs. Each program is called a project. It is very important to understand the concept of projects. A project is a collection of programs and resources under one name and treated as a single unit. Thus if we are creating a software, it is not necessary to have different files strewn everywhere, instead each file and code is categorized and kept under one roof called project and when needed they are compiled.........
Chapter 4 Hello World C# Program
using System;
This is another keyword which tells the compiler that we are going to use all the classes in the namespace system. Thus we have used Console.WriteLine. Point to be noted is we cannot use classes which are inside internal namespace like System.Text.
This is another keyword which tells the compiler that we are going to use all the classes in the namespace system. Thus we have used Console.WriteLine. Point to be noted is we cannot use classes which are inside internal namespace like System.Text.
Chapter 5 An Introduction to C# Data-Types
As we all know every programming language has Constants and Variables. These can be of different types. Basically there are two kinds of constants Numeric and Alpha-Numeric or String. Thus to store these values we need different type of variables. Obviously same two classification applies but under numeric they can be signed,unsigned,float,double etc. We call these classifications based on the values stored as data types. This chapter will look into the different data types in C#.
Chapter 6 Operators In C#
Operators in C#
Every programming language must have Arithmetic Operators. Given below are the Arithmetic Operators used in C#Chapter 7 Selection Statements
A selection statement causes the program control to jump to another part of the program depending on a condition. Following are the selection statement available to you under C#
- if
- else
- switch
- case
- default
Chapter 8 Iteration Statements
Iteration is to repeat or loop a certain block of code. the number of time this iteration will take place depends on the condition specified by the programmer. every loop must have a proper ending else it becomes an infinite loop.
The following statements can be used to create loop or iterations
The following statements can be used to create loop or iterations
- do
- for
- foreach
- while
Chapter 9 Arrays
Arrays are one of the most useful and powerful tools of programing, they are used everywhere from the mundane task like sorting and searching to the exotic like 3-D graphics and modelling. Lets look at the concept of an array.
If we have 100 similar data or homogeneous data then instead of declaring 100 same type of variables we take an array, it is a collection of values with the same or similar data type.Again if we simplify it a bit further then the best example will be a row of houses in a colony. Lets assume you live on the E-Block of colony or city. But is it enough to say to your friend "Come visit me, my address is E-Block". the answer is no because in E-Block there can be thousands of houses which look alike, therefore you qualify your address with a number. That number identifies your house in that block for e.g E-1209. Same can be said about an array, instead of taking different variables we take one and each cell under this variable has a number as an address called index.
If we have 100 similar data or homogeneous data then instead of declaring 100 same type of variables we take an array, it is a collection of values with the same or similar data type.Again if we simplify it a bit further then the best example will be a row of houses in a colony. Lets assume you live on the E-Block of colony or city. But is it enough to say to your friend "Come visit me, my address is E-Block". the answer is no because in E-Block there can be thousands of houses which look alike, therefore you qualify your address with a number. That number identifies your house in that block for e.g E-1209. Same can be said about an array, instead of taking different variables we take one and each cell under this variable has a number as an address called index.
Chapter 10 Object & Classes in C# Part I
C# is a powerful Object Oriented programming language. Lets first look at some basics of OOPs then we will see how C# implements it.
What are Objects ?
Objects are key to understanding object-oriented technology. Look around right now and you'll find many examples of real-world objects: your bicycle, you yourself, your car etc.
Real-world objects share two characteristics: They all have state and behavior.
What are Objects ?
Objects are key to understanding object-oriented technology. Look around right now and you'll find many examples of real-world objects: your bicycle, you yourself, your car etc.
Real-world objects share two characteristics: They all have state and behavior.
Chapter 10 Object & Classes in C# Part II
This chapter continues from the earlier chapter thus if you have not read it. please do so before proceeding further.
Constructor
These are special methods which get called at the time of object creation automatically. They cannot be called later by the user.. Constructors allow the programmer to set default values, limit instantiation, and write code that is flexible and easy to read.Chapter 11 Inheritance in C#
As we had discussed earlier inheritance is one of the cornerstones of OOPS. Thus C# follows it too. You may have noticed that all framework classes inherit form one single class called Object. In this chapter we will look into the actual implementation aspect of inheritance.
STEP 1
To begin with lets design a simple Animal class.It will have three methods
Constructor
Talk
Greet
Each one will print out a message with the Animal word included so that we know which class is responding to us
STEP 1
To begin with lets design a simple Animal class.It will have three methods
Constructor
Talk
Greet
Each one will print out a message with the Animal word included so that we know which class is responding to us
Chapter 12 Strings in C#
A string is an object of type String whose value is text. Internally, the text is stored as a sequential read-only collection of Char objects. There is no null-terminating character at the end of a C# string; therefore a C# string can contain any number of embedded null characters ('\0').
As mentioned earlier string is just an alias for the class System.String. You can use either of the two to use strings and each provide you with multiple functions to make your life easier. We will look at each of them one by one.
Immutability
String are immutable. It means they cannot be changed after they have been created. All of the String methods and C# operators that appear to modify a string actually return the results in a new string object. In the following example, when the contents of x1 and x2 are concatenated to form a single string, the two original strings are unmodified. The += operator creates a new string that contains the combined contents. That new object is assigned to the variable x1, and the original object that was assigned to s1 is released for garbage collection because no other variable holds a reference to it.
As mentioned earlier string is just an alias for the class System.String. You can use either of the two to use strings and each provide you with multiple functions to make your life easier. We will look at each of them one by one.
Immutability
String are immutable. It means they cannot be changed after they have been created. All of the String methods and C# operators that appear to modify a string actually return the results in a new string object. In the following example, when the contents of x1 and x2 are concatenated to form a single string, the two original strings are unmodified. The += operator creates a new string that contains the combined contents. That new object is assigned to the variable x1, and the original object that was assigned to s1 is released for garbage collection because no other variable holds a reference to it.
Chapter 13 ADO.NET in VB.net
ADO.NET provides consistent access to data sources such as Microsoft SQL Server and XML, as well as to data sources exposed through OLE DB and ODBC. Data-sharing consumer applications can use ADO.NET to connect to these data sources and retrieve, manipulate, and update the data that they contain.
ADO.NET separates data access from data manipulation into discrete components that can be used separately or in tandem. ADO.NET includes .NET Framework data providers for connecting to a database, executing commands, and retrieving results. Those results are either processed directly, placed in an ADO.NET DataSet object in order to be exposed to the user in an ad hoc manner, combined with data from multiple sources, or remoted between tiers. The ADO.NET DataSet object can also be used independently of a .NET Framework data provider to manage data local to the application or sourced from XML.
ADO.NET separates data access from data manipulation into discrete components that can be used separately or in tandem. ADO.NET includes .NET Framework data providers for connecting to a database, executing commands, and retrieving results. Those results are either processed directly, placed in an ADO.NET DataSet object in order to be exposed to the user in an ad hoc manner, combined with data from multiple sources, or remoted between tiers. The ADO.NET DataSet object can also be used independently of a .NET Framework data provider to manage data local to the application or sourced from XML.
Chapter 14 Exceptions
In simple terms Exceptions are errors. these are not the errors that are checked by any compiler. To be more simplistic any error which is not related to Syntax is called an Exception. Raising an exception is when an error occurs during the execution of a program forcing it to pause or break out.We have seen frequently that some new application or games when executing suddenly open a window and give you a message such as DirecteX missing or file missing or out of memory and most of these windows are followed by the application crashing or the application being shut down.
Thus as a programmer it is our duty to anticipate these kind of errors and make sure that the program exits gracefully.
DotNet has a basic Exception class which encompasses all kind of exceptions. This basic class has many child classes which represent specific exceptions. Difference being the parent class can represent every single exception but the child class can represent only specific type of exceptions. Below is a digram for all the exceptions present and their hierarchy.
Thus as a programmer it is our duty to anticipate these kind of errors and make sure that the program exits gracefully.
DotNet has a basic Exception class which encompasses all kind of exceptions. This basic class has many child classes which represent specific exceptions. Difference being the parent class can represent every single exception but the child class can represent only specific type of exceptions. Below is a digram for all the exceptions present and their hierarchy.