Thursday, September 22, 2011

How to Install Visual Studio 2010 (Dotnet 4.0 Setup)

How to Install Visual Studio 2010 : Dot net 2010 : .Net Frame Work 4.0
First Install IIS internet information server
Than open your VS 2010 folder


Step 1 :
-----Click on Set up,  below pop up will appears on ur  Desk Top, click on Install MicroSoft Visual Studio 2010


Step2 :
----Click on the Next Button 
Step 3:
----- Select, I have read and accept the licence terms
-----Than click on Next button

Step 4 :

----- Select Options Full or Custom
 Default Full
----- If u don't have required space in u r C:// drive , use another drive to save visual studio program files in ur PC
by using browse button on right hand side
Step : 5 :

---Click on Next Button
Step 6 :
--- Wait for Installation
--- One Pop Up will appears on ur  Desk Top with Success Message
----Click on Finish Button

Just click on Exit if any pop up will appears on ur  Desk Top

Step 7 :
Now Click on Start Up Button
Click on All programs
Scroll it find Visual studio 2010
Click on that

Step 8 :

Right Click on The Microsoft Visual Studio 2010 Copy and Paste it on Desktop


U will find Short Cut symbol in ur desktop

Double Click on it
One Pop Up will appears in ur desktop Select Visual C development Settings

Click on Start Visual  Studio ........

Saturday, September 3, 2011

Differences of ASP.NET 2.0/3.0/3.5/4.0

ASP.NET 2.0
1.Improve the Reliability and Usability of WebApplication
2.Reduce the Number of Lines of Code you have to write in common scenarios
3.Offer User Features to Personalize Web Applications
4.Provide enhanced design Features to generate consistent layouts and design

-----MasterPages
-----NestedMasterPages
-----Themes and Skins
-----Membership
-----LoginControls
-----Profile Properties
-----Web Parts

As we all know, ASP.NET 3.5 has introduced with the following main new features

1) AJAX integration
2) LINQ
3) Automatic Properties
4) Lambda expressions

Monday, August 29, 2011

Best Practice WCF For Beginners

WCF
Windows Communication Foundation

Windows Communication Foundation provides broad interoperability and direct Support for service orientation,
The Global Acceptance of web services, which includes standard protocols for application to application communication, has changed software development. For Example,The functions that web services now provide include security, distributed transaction coordination,and reliable communication. the benefits of the changes in web services should be reflected in the tools and technologies that developers use.

Windows Communication Foundation (WCF) is a Frame Work for Building Service-Oriented Applications.Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS,or it can be a service hosted in an application. An Endpoint can be a client of a service that request data from a service endpoint. the messages can be as simple as a single character or word sent as XML, or as complex as stream of binary data.

A service that Supplies Current Data to Others, such as a traffic report or other monitoring service.
A chat  service that allows two people to communicate or exchange data in real time.
A dashboard application that polls one or more services for data and presents it in a logical presentation.
Exposing a workflow implemented using windows workflow foundation as a wcf service.
A silverlight application to poll a service for the latest data feeds.

Service Orientation
Interoperatbility
Multiple Message Patterns
Service Metadata
Data Contracts
Security


Multiple Transports and Encodings
Reliable and Queued Messages
Durable Messages
Transaction
Ajax And REST Support
Extensibility

A simple Example of WCF Service



Tuesday, August 23, 2011

Application State Management in asp.net

Application State is a Data Repository available to all Classes in an ASP.Net application state is Stored in memory of the server and is faster than storing and retrieving information in a database. Unlike session state, which is  specific to single user session, application state applies to all users and sessions. Therefore, application state is useful place to store small amounts of ofter-used data that does not change from one user to another.

Application State is stored in an instance of the HttpApplicationState Class.

Saving values in Application State
(C#)
Application["UserName"]="SimpleUserName";
Application["values"]="Some values";

Reading the values
(C#)
string username= Application["UserName"].Tostring();



ASP.NET Page Life Cycle

ASP.NET Page Life-cycle

Page Request
The page request occurs before the page life cycle begins. when the page is requested by a user, asp.net determines whether the page needs to be parsed and compiled (therefore beginning the life of of a page), or whether a cached version of the page can be sent in response without running the page.
Start
In the start stage, page properties such as Request and Response are set. At this stage, the page also determines whether the request a post back or a new request and sets Ispostback property. the page also sets the UICulture property.
Initialization :
During page initialization, controls on the pager are available and each control's UniqueID property is set. A master page and themes are also applied to the page if applicable. if the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state
Load
During load, if the current request is postback, control properties are loaded with information recovered from view state and control state.
Post Back Event Handling
If the request is a postback, control event handlers are called. after that, the validate method of all validator controls is called, which sets the Isvalid property of individual validator controls an of the page
Rendering
Before rendering, view state is saved for the page and all controls. During the rendering stage, the page calls the Render method for each control, providing  a text writers its output to the output stream object of the page's response property.
Unload
The unload event raised after the page has been fully rendered, sent to the client, and is ready to be discarded. at this point, page properties such as response and request are unloaded and cleanup is performed.



How to Create Temparory Table

By using the below query we can able to create the temp table

SELECT * INTO #TEMPTABLENAME FROM TABLENAME

Tuesday, May 24, 2011

Software Development Models

In Software Development process we have different models to adopt to complete the Project and sometimes combination of Development process also used in Development process.

We Have Basic Knowledge on Software Development Cycle 

if we adopt one process it makes easy to develop  Projects.

We Have Four Types Of Development Processes
They are

1.Water Fall Model
2.Spiral Model
3.Iterative and Incremental Development
4.Agile Development

Tuesday, May 10, 2011

Simple Linq To Sql Example

How to Use Linq to sql in dotnet ?

--Take the Class with same name of Database
--Than Inherit With Class DotContext
--For This Class u have to add Linq ,data,Mapping references to project

--Using System.Linq.Data;
--Using System.Linq.Data.Mppaing
Ex:

public class Mydatabase() :DotContext
{

}

Monday, May 9, 2011

Differecne Between Interfaces and Abstract ?

Differences between Interface and Abstract Class?
Interfaces :
--An interface is not a class.
--It is an entity that is defined by the word Interface.
--An interface has no implementation;
--it only has the signature or in other words, just the definition of the methods without the body. As one of the similarities to Abstract class
 ____________________________________
Public Interface ImyInterface

{
String Method1();
int Method2();

}
Public Class myClass :ImyInterface
{
string Method1()
{
//Code
}
int Method2()
{
//Code
}
}
____________________________________________________________________________
---Requires more time to find the actual method in the corresponding classes. (Slow )


The main difference between them is that a class can implement more than one interface but can only inherit from one abstract class. Since C# doesn't support multiple inheritance, interfaces are used to implement multiple inheritance

  Abstract Class:
   These Classes Cannot be instantiated, 
 ---These are used if additional functionality is needed in derived classes,
 ---These Implemented partially or No Implementation
--Fast In Operation
 ____________________________________________________________
abstract class MyAbstractClass
{
public MyAbstractClass()
{
// Code to initialize the class goes here.
}

abstract public void Method1();
abstract public void Method2(int A);
abstract public long Method3(int B);
}
class MyClass : MyAbstractClass
{
public MyClass ()
{
// Initialization code goes here.
}

override public void Method1()
{
// code goes here.
}

override public void Method2(int A)
{
// code goes here.
}

override public long Method3(int B)
{
//code goes here.
}
}


What is OOPS Concepts ?

OOPS Concepts 
   
Ans:  Object Oriented Programming (OOP) All Programming Language will support this OOP there are Three main concepts in OOP
   a)Encapsulation
   b)Abstraction
   c)Inheritance
   d)Polymorphism
Encapsulation  :
Encapsulation is the process of Keeping the data and method together into Objects
OR
Simple Putting Together into one simple class Like.
OR
Means that a group of related properties, methods, and other members are treated as a single unit or object.
_____________________________________________________________
Class My Class
{
public MyClass()
{

}
int a;
int b;
Public void GetAdd()
{
 int C=a+b;
}

}
____________________________________________________________

Abstraction : Hiding the Data
Inheritance:
Inheritance Enables  you to Create Class that Reuses
OR
Acquiring the Properties of Base Class(Parent Class)
OR
Means Provide Further Implementation ,Reusing of  Base Class
__________________________________________________________
Public Class MyClass
{
Public MyClass()
{
}
int a;
int b;
Public void GetMyMethod()
{
int c=a+b;
}
}
Public Class MyChildClass : MyClass
{
 Public MyChildClass()
{}
}
C# Doesn't Support Multiple Inheritance By Using Interfaces We Can 


Polymorphism
Polymorphism means same operation may Behave Differently in Different Classes

Example of Compile Time Polymorphism: Method Overloading
Example of Run Time Polymorphism: Method Overriding

Method Overloading- Method with same name but with different arguments is called method overloading.
- Method Overloading forms compile-time polymorphism.
- Example of Method Overloading:
class MyClass
{
Public string hello()
{
return "Hello";
}
public string hello(string s)
{
return "Hello"+S.Tostring();
}
}

Method Overriding- Method overriding occurs when child class declares a method that has the same type arguments as a method declared by one of its superclass.
- Method overriding forms Run-time polymorphism.
-Virtual Key word is required for Overriding
- Example of Method Overriding:
Public Class MyClass
{
virtual void hello()
{
Console.WriteLine(“Hello from MyClass”);
}
}
Public Class MyChildchild : MyClass
{
override void hello()
{
Console.WriteLine(“Hello from Child”); }
}
}________________________________________________

What is the Difference Between Script Manager and Script Manager Proxy ?

What is the difference between Script Manager and ScriptManager Proxy ?
ans : A page can contain only one scriptmanager control. if you have a master content page in ur application and  the master  contains a script manager control, then you can use the scriptmanager proxy control to add script to content pages


Also, If you come across scenario where only a few pages in your application need to register to script or a web service, then its best to remove them from the script manager control and add them to individual pages, by using the script manager proxy control. that is because if you added the scripts using the script manager on the master page, then these items will be downloaded on each page that derives from the masterpage, even if they are not needed, which would lead to waste of resources.