class operatordemo
{
int a, b;
string s1, s2;
public operatordemo()
{
a = 10; b = 20; s1 = "csharp"; s2 = ".net";
}
public static int operator +(operatordemo r1, operatordemo r2)
{
int tot;
string str;
str = r1.s1 + r2.s2;
tot = r1.a + r2.b;
MessageBox.Show(str);
return tot;
}
}
private void button1_Click(object sender, EventArgs e)
{
operatordemo obj1 = new operatordemo();
operatordemo obj2 = new operatordemo();
int t;
t = obj1+obj2;
MessageBox.Show(t.ToString());
}
Press F5 and you see this Outputs


First Page in Operator Overloading
Operator Overloading:
Using operator overloading we can change the meaning to the existing operator, All operator over-loading functions should be static, Using operator keyword we can over-load unary-operator and binary operators.
Example on Operator Overloading:
Start Microsoft Visual Studio - Click on file- New- Open New Project



You need to include this Overloading functions in Our Class Named "emp" as shown below
class emp
{
int ts;
//I am creating three functions using same name
public void tsal(int sal)
{
MessageBox.Show(sal.ToString(),"Salary");
}
public void tsal(int sal,int bonus)
{
ts = sal + bonus;
MessageBox.Show(ts.ToString(),"Salar+Bonus is ");
}
public void tsal(int sal, int bonus, int ta)
{
ts = sal + bonus + ta;
MessageBox.Show(ts.ToString(),"Salary+Bonus+ta is ");
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
//I am calling three functions using button click event
private void button1_Click(object sender, EventArgs e)
{
emp e1 = new emp();
int s, b, t;
s = 5000;
b = 300;
t = 200;
e1.tsal(s);
e1.tsal(s,b);
e1.tsal(s,b,t);
}
Coming to the Output Use f5
You see a window as shown below
Function Overloading
Using function overloading we can implement any no.of functions with the same name. by providing different prototypes or Arguments, While implement the function overloading we have to check only with function name and with the parameters, not with the return types.
Example on Function Over-loading
Start Microsoft Visual Studio - Click on file- New- Open New Project

Designtime Binding:
In the design time binding the total instructions we can give using design mode to the compiler the design time binding we can classify in to two types
- Function Overloading
- void tsal()
- void tsal(int s)
- void tsal(int s,int b)
- int tsal();
- Operator Overloading
- 10+20
- str+str
- obj+obj
Polymorphism :
The polymorphism is the concept of sharing and ability features to the multiple forms, The polymorphism. we can classify into two types
- Designtime Binding
- Runtime Binding
- virtual function




But right click the AssemblyInfo.cs tab at the top, and click Close from the menu. Now, in the Solution Explorer, click the plus symbol next to References:

Before we add some code, let's save the project. We'll do that in the next part below.
Previous Page


When you click OK, a new Console Application project will be created for you. Some code should be displayed:

As well as the code, have a look on the right hand side and you'll see the Solution Explorer. This is where all the files for your project are. (If you can't see the Solution Explorer, click View from the C# menu bar at the top. From the View menu, click Solution Explorer.)
- How to create new projects
- What the Solution Explorer is
- The various files that make up of a C# .NET project
- How to save your work
- How to run programmes
- The importance of the Main statement
Open the Visual C# Express software from your programs menu. When you first open C# (pronounced C Sharp), you should see a screen something like this (screenshot is for 2005 version, but 2008 version is the same):

When you're looking at this piece of software for the first time, it can seem hugely complex and daunting. The temptation is to think you're never going to get to grips with something so difficult. But don't worry - after a few lessons things will start to feel familiar, and you won't feel nearly half as intimidated as you do now!
A Simple C# Console Application
A Console Application is one that looks like a DOS window. If you don't know what these are, click your Start menu in the bottom left of your screen. Click on Run. From the dialogue box that appears, type cmd:


Asp.Net Interview Question
What is the difference between DataList and Repeater data binding controls?
Answer: The DataList control is similar to the Repeater control. However, it has some additional properties and templates that you can use to display its data in a diverse fashion. The Repeater control does not have any built-in layout or style. We are forced to specify all formatting-related HTML elements and style tags. On the other hand, a DataList control provides more flexibility to display data in a desired layout. It also provides data selection and editing capabilities. How does it do it? Well, in addition to the five templates (Item Template, AlternatingItem Template, Separator Template, Header Template, Footer Template that a repeater has, the DataList control has two more templates: SelectedItemTemplate, and EditItemTemplate. These templates are useful for allowing data selection and data editing functionalities.
Furthermore, the RepeatDirection and RepeatColumns properties of a DataList control can be exploited to lay out the data in horizontal or vertical fashions.
By DesiBindaas | On Friday, February 12, 2010 2:30 PM
Category:
Namespace:
.Net framework is the collection of namespaces, every namespace is dynamic link library(DLL), namespaces having collection of object oriented programing features, namespaces features we can distribute in the all .Net technologies.

Ommon Language runtime(CLR)