Sunday, June 24, 2007

New to .NET - Please suggest an approach to learn .net

A common question for every .Net Beginner is how do i start .Net, one such question i come across was exactly my question when i had started my career in .Net

I'm new to .NET and I want to learn .NET specially C# and ASP.net.
I've Java background, I mean to say I had Java as part of my
curriculum.

Can anyone suggest me what approach do I need to take inorder to
learn .NET.

If anyone has any good material on .NET Framework,C# and ASP.NET, I
would appreciate if you can forward it to me.



Approach 1:
You can start downloading video tutors @ http://asp.net/ (http://asp.net/getstarted/default.aspx?tabid=61) or http://www.learnvisualstudio.net/ for series of video tutorial for beginners.


Approach 2:
You can also search for more video tutorials on google videos, youtube... or microsoft elearning site for webcast.

Approach 3:
You can also start with http://www.csharp-station.com/ and
http://dotnetspider.com/tutorials/ its a good site to start with Soon http://dailyfreecode.com/ will be launching so you will find lot
more there tooo.

Approach 4:
If you still want more links just type "c# tutorial" @
http://search.dailyfreecode.com/ and u will find lot more relevant links.

Approach 5:
For asp.net best way to start is to purchase amit kalani's 70-315
book.... it explains each and everything in a very simple manner,
besides on completion of it u wud able to pass MCP paper 70-315.


I guess this will help to start with... ones u start knowing the things u will able to judge more which one is best for u...

Good Luck,
Welcome to .Net world

Friday, June 22, 2007

Understanding DateTime and TimeSpan in .Net through real time example


Understanding DateTime and TimeSpan in .Net through real time example



//Creating Two Instance of DateTime
DateTime dt1 = new DateTime();
DateTime dt2 = new DateTime();


//Initializing DateTime Object
dt1 = DateTime.Now.Date; //Initializing with Current Date
Response.Write(dt1.ToString() + "<br>");
//Output: 22-06-2007 00:00:00

//Examples for DateTime Manipulation in .Net
//Example 1 : Adding Minutes to Current Date.
dt1 = dt1.AddMinutes(5.0);
Response.Write(dt1.ToString() + "<br>");
//Output: 22-06-2007 00:05:00

//Example 2 : Adding Seconds to DateTime Object., similarly you can add milliseconds
dt1 = dt1.AddSeconds(30.0);
Response.Write(dt1.ToString() + "<br>");
//Output: 22-06-2007 00:05:30

//Example 3 : Adding Hours to DateTime Object in .Net.
dt1 = dt1.AddHours(5.0);
Response.Write(dt1.ToString() + "<br>");
//Output: 22-06-2007 05:05:30

//Example 4 : Adding Time to DateTime Object.
//You can replace Example 1,2 and 3 by simply adding TimeSpan with your desired
//TimeSpan value.
//Here we are adding 5 Hours, 5 Minutes and 30 Seconds.
dt1 = dt1.Add(new TimeSpan(5,5,30));
Response.Write(dt1.ToString() + "<br>");
//Output: 22-06-2007 10:11:00

//Example 5 : Adding Days to DateTime Object in .Net
dt2 = dt1.AddDays(7.0); //Initializing dt2 object with 7 days ahead from
//dt1 DateTime value.
Response.Write(dt2.ToString() + "<br>");
//Output: 29-06-2007 10:11:00

//Example 6 : Adding Month to DateTime Object
dt2 = dt2.AddMonths(1);
Response.Write(dt2.ToString() + "<br>");
//Output: 29-07-2007 10:11:00

//Example 7 : Adding Year to DateTime Object
dt2 = dt2.AddYears(1);
Response.Write(dt2.ToString() + "<br>");
//Output: 29-07-2008 10:11:00


//Examples of Retrieving DateTime object value.
//Example 1 : Get Day value.
int intDay = dt1.Day;
Response.Write(intDay.ToString() + "<br>");
//Output: 22

//Example 2 : Get Day of Week.
DayOfWeek dow = dt1.DayOfWeek;
Response.Write(dow.ToString() + "<br>");
//Output: Friday
//How to find whether day of week is sunday or saturday?
if(dow == DayOfWeek.Sunday dow == DayOfWeek.Saturday)
{
//Hurray its weekend.
}

//Example 3 : Get the Day of Year
int intYear = dt1.DayOfYear; //Similarly you can get Year value.
Response.Write(intYear.ToString() + "<br>");
//Output: 173


//Similarly you can get Hours, Minutes, Seconds, Milliseconds value.



//Conversion of String to DateTime
//Make use of Parse Method of DateTime to "Convert String to DateTime in .Net"
DateTime dt4 = DateTime.Parse("08/06/2007");
DateTime dt5 = DateTime.Parse("10/06/2007");

//Comparing Date
//How to Find whether both dates are equal or Not?
//How to compare two dates in .Net?
if (DateTime.Compare(dt4, dt5) == 0)
{
Response.Write("Both Dates are Equal" + "<br>");
}
else if (DateTime.Compare(dt4, dt5) < 0)
{
Response.Write(dt4.ToString() + " is Less than "
+ dt5.ToString() + "<br>");
}
else
{
Response.Write(dt4.ToString() + " is Greater than "
+ dt5.ToString() + "<br>");
}
//Output: 08-06-2007 00:00:00 is Less than 10-06-2007 00:00:00
/*Note: You may recieve error: "String was not recognized as a valid
DateTime." This may be occur as in India the DateTime format is followed
as "dd/mm/yyyy" But let say if you are in USA than it follow "mm/dd/yyyy" so here
there is crash situation and so you might recieve above error, so to avoid such
error make sure that user input valid date before you Parse date. */


//Difference between Date
//How to Find difference between two dates in .Net?
//How to Find days difference between two dates in .Net?
//How to subtract one date from another?
TimeSpan tsDiff = dt5.Subtract(dt4); //Note: Always subtract smaller date
//value from greater date
Response.Write("Difference between " + dt4.ToString() + " and " +
dt5.ToString() + " is " + tsDiff.Days.ToString() + " days." + "<br>");
//Output: Difference between 08-06-2007 00:00:00 and 10-06-2007 00:00:00 is 2 days.


//Similarly you can also find:
//How many hour difference between two dates
//How many seconds difference between two dates
//And so on... by changing tsDiff property value to hours, seconds....
//instead of tsDiff.Days.


//Compare Time
//How to Find whether both Time are equal or Not?
//How to compare Time in .Net?
dt4 = DateTime.Parse("4:30 AM");
dt5 = DateTime.Parse("7:30 PM");
if (DateTime.Compare(dt4, dt5) == 0)
{
Response.Write("Both Times are Equal" + "<br>");
}
else if (DateTime.Compare(dt4, dt5) < 0)
{
Response.Write(dt4.ToShortTimeString() + " is Less than "
+ dt5.ToShortTimeString() + "<br>");
}
else
{
Response.Write(dt4.ToShortTimeString() + " is Greater than "
+ dt5.ToShortTimeString() + "<br>");
}
//Output: 04:30:00 is Less than 19:30:00


//Difference between Time
//How to Find difference between two Time value in .Net?
//How to Find Hours difference between two Time in .Net?
//How to subtract one Time from another?
//How to find elapsed Time between Two Time value in .Net?
tsDiff = dt5.Subtract(dt4); //Note: Always subtract smaller date
//value from greater date
Response.Write("Difference between " + dt4.ToString() + " and " + dt5.ToString() + " is " + tsDiff.Hours.ToString() + " Hours." + "<br>");
//Output: Difference between 22-06-2007 04:30:00 and 22-06-2007 19:30:00 is 15 Hours.


//More on DateTime
//How many days in a given month in .Net?
int intDaysInMonth = DateTime.DaysInMonth(2007, 6); //Pass valid year, and month
Response.Write(intDaysInMonth.ToString() + "<br>");
//Output: 30

//How to find whether given year is Leap year or not in .Net?
Response.Write( DateTime.IsLeapYear(2007)); //Pass valid year
//Output: False

//How to find current date and time?
Response.Write("Current Date and Time: " + DateTime.Now + "<br>");
//Output: Current Date and Time: 22-06-2007 11:31:04

//How to find current date?
Response.Write("Current Date: " + DateTime.Today + "<br>");
//Output: Current Date: 22-06-2007 00:00:00

Wednesday, June 20, 2007

Testing your web design in different browsers

Test your web page in different browser

Browsershots makes screenshots of your web design in different browsers. It is a free open-source online service created by Johann C. Rocholl. When you submit your web address, it will be added to the job queue. A number of distributed computers will open your website in their browser. Then they will make screenshots and upload them to the central server here.

http://browsershots.org/

Now testing your website design for different browser compatibility is easy with browsershots

One Line Quote for messenger

Hello friends, most of us have habit of displaying quote in our messenger, here is some quote collected by me from MyDailyFun blog

So here are some small but effective quotes collection.

  1. Do not deceive people. Sincerity is the best way to impress.
  2. You never get a second chance to make a good first impression.
  3. There is no road to success but through a clear strong will power.
  4. Everyone is wise until they speak.
  5. One crowded hour of glorious life is worth an age without a name.
  6. To Improve is to change, to aim for perfection is to change often.
  7. You cannot give away kindness, it will always come back to you.
  8. Politeness is the art of selecting among one’s real thoughts.
  9. Success occurs when opportunity and presentation meet.
  10. The full use of today is the best preparation for tomorrow.
  11. A reputation is precious, but a character is priceless.
  12. Knowledge is power but action gets things done.
  13. The future belongs to those who know how to wait.
  14. The winner is he who gives himself to his work, body and soul.
  15. A good deed is never lost.
  16. Character is property. It is the noblest of possession.
  17. Don’t sit and wait – look for the next opportunity.
  18. Commit yourself to a life of self – improvement.
  19. They are never alone that are accompanied with noble thoughts.
  20. Patience and time can be your two best friends.
  21. Try making everyday a day of achievements.
  22. Condemn the fault, and not the actor of it.
  23. Knowledge is a treasure but practice is the key to it.
  24. Results count – not long hours of effort.
  25. Nothing great was ever achieved without enthusiasm.
  26. It is a man like to punish but god like to forgive.
  27. Focus on making things better – not bitter.
  28. Happiness comes from within, it can never come from outside.
  29. Indecision can be your worst mistake.
  30. Manners are of more importance than laws.
  31. Always leave your audience with a memorable message.
  32. There is no virtue so truly great and good like a justice.
  33. Patience is a necessary ingredient of genius.
  34. Silence is more eloquent than words.
  35. The wise does at once what the fool does at last.
  36. Wise man learns from others mistake.
  37. Anger shows the character of person.
  38. If you have confidence in yourself, others will too.
  39. Success is counted sweetest by those who never succeed.
  40. He that falls in love with himself will have no rivals.
  41. You may judge a flower by its look but not a human being.
  42. People stumble not on mountains but on small stones.

Enjoy free Quote collection, Motivational and Inspirational Stories, Daily life lessons and more which relief your stress and keeps you going at MyDailyFun Blog

Monday, June 18, 2007

Difference between "==" and "object.equalsto"

What is the difference between "==" and "object.EqualsTo"

"==" Vs "Object.EqualsTo"

'==' only compares the value where as 'object.equalsto' compares the both value as well as type

Both are used for comparison and both returns the boolean value (true/false)

Case 1. In case a and b both are different datatype then also a.Equals(b) can be used to compare but incase of == we cant even compile the code if a and b are different data type

Example1 for "==" Vs "Object.EqualsTo":

int a=0;
string b="o";

if(a.Equals(b))
{
//do something
}

//above code will compile successfully and internally the int b will convert to object type and compare

if(a==b)
{
//do something
}
//above code will give you the compilation error


Case 2. by using == we cant compare two object but Equals method will able to compare both the object internally

Example 2 for "==" Vs "Object.EqualsTo":
a==b is used to compare references where as a.Equals(b) is used to compare the values they are having.
for e.g

class Mycar
{
string colour;
Mycar(string str)
{
colour = str;
}
}

Mycar a = new Mycar("blue");
Mycar b = new Mycar("blue");
a==b // Returns false
a.Equals(b) // Returns true

Difference between Close() and Dispose() Method

Difference between Close() and Dispose() Method

Close() Vs Dispose Method

The basic difference between Close() and Dispose() is, when a Close() method is called, any managed resource can be temporarily closed and can be opened once again. It means that, with the same object the resource can be reopened or used. Where as Dispose() method permanently removes any resource ((un)managed) from memory for cleanup and the resource no longer exists for any further processing.

Example showing difference between Close() and Dispose() Method:


using System;
using System.Data;
using System.Data.SqlClient;
public class Test
{
private string connString = "Data Source=COMP3;Initial Catalog=Northwind;User Id=sa;Password=pass";
private SqlConnection connection;
public Test()
{
connection = new SqlConnection(connString);
}
private static void Main()
{
Test t = new Test();
t.ConnectionStatus();
Console.ReadLine();
}
public void ConnectionStatus()
{
try
{
if(connection.State == ConnectionState.Closed)
{
connection.Open();
Console.WriteLine("Connection opened..");
}

if(connection.State == ConnectionState.Open)
{
connection.Close();
Console.WriteLine("Connection closed..");
}
// connection.Dispose();

if(connection.State == ConnectionState.Closed)
{
connection.Open();
Console.WriteLine("Connection again opened..");
}
}
catch(SqlException ex)
{
Console.WriteLine(ex.Message+"\n"+ex.StackTrace);
}
catch(Exception ey)
{
Console.WriteLine(ey.Message+"\n"+ey.StackTrace);
}
finally
{
Console.WriteLine("Connection closed and disposed..");
connection.Dispose();
}
}
}

In the above example if you uncomment the "connection.Dispose()" method and execute, you will get an exception as, "The ConnectionString property has not been initialized.".This is the difference between Close() and Dispose().

difference between Copy and Clone Method

What is the difference between Copy and Clone Method.

Copy Vs Clone Method

Clone will copy the structure of a data where as
Copy will copy the complete structure as well as data .

Sunday, June 17, 2007

Windows Hardware Assement and Upgrade Advisor

My Friend Pankaj has posted a Good Information for those who want to upgrade to Windows Vista.

Windows Vista Hardware Assessment

The Windows Vista Hardware Assessment solution accelerator is an inventory,
assessment, and reporting tool that will find and determine if computers on a
network are ready to run the Windows Vista operating system.

More Info

Windows Vista Upgrade Advisor 1.0

Windows Vista Upgrade Advisor is designed to help Windows XP users identify whether their PCs are ready for an upgrade to Windows Vista, which edition of Windows Vista meets their needs, and which features of Windows Vista will be able to run on their PCs

More Info

Best Laptop PC

Points to be consider while purchasing laptop

  • Identify your needs based on your daily work load
    • Laptop for programmer - Look for High Performance PC
    • Laptop for Designer - Look for High Graphics Performance PC
    • Laptop for Game Lover - Look for both High Performance and High End Graphics Enabled.
    • Laptop for Executive - Look for Laptop with comfortable performance speed and latest ads-on.
  • Make your budget upto which you can spend for Laptop PC
  • Prepare your configuration needs
    • How much RAM
    • Which Processor
    • How much hard disk space
    • How much USB cables
    • Will it should support wireless network
    • And so on...
  • Best Company to buy laptop, below mention list is based on current popularity to purchase laptop.
    1. SonyVAIO
    2. Apple
    3. Dell
    4. Toshiba
    5. HP
    6. Lenovo
    7. Acer
  • Best Shop to buy laptop, now decide best shop
    • CircuitCity
    • BestBuy
    • And so on...
  • Asking for Rebates or Free Offers
    • Most of Laptop PC's have Rebate on it or Free Offers, so don't forget to take advantage of it.
  • I hope above mention points will help you to make Best Laptop Deal.

Top Ten Laptop


Toshiba Qosmio G35 Most tricked-out multimedia laptop

Toshiba Qosmio G35



Sony VAIO SZ Best balance between portability and usability

Sony VAIO SZ



Lenovo ThinkPad X60s Best ultraportable notebook for business

Lenovo ThinkPad X60s



Gateway NX100X Best budget ultraportable design

Gateway NX100X




HP Compaq Presario V5000Z Most affordable laptop

HP Compaq Presario V5000Z




Dell XPS M1710 Best gaming laptop

Dell XPS M1710



Panasonic ToughBook 74 Best laptop for the extremely accident-prone

Panasonic ToughBook 74




Sony VAIO UX Best microtablet

Sony VAIO UX



MacBook Pro Best laptop design

MacBook Pro




Dell XPS M2010 Best laptop that's not a laptop

Dell XPS M2010




Well this was all reviews from Net, but i personally feel as a programmer, Sony T7100 is best for less.

Sony VAIO® VGN-FZ140E/B 15.4” Widescreen Notebook PC

Sony VAIO 15.4” Widescreen Notebook PC (VGN-FZ140E/B)

•Intel Core 2 Duo T7100
•200GB hard drive
•Burn DVDs and CDs

•2GB of DDR2 memory
•Built-in 802.11abgn wireless
•Windows Vista Home Premium


For more models and online choice check out
http://curcuitcity.com

Saturday, June 16, 2007

.Net Framework 3.0 FAQ

.Net Framework 3.0, WPF, WCF, WF, XAML Interview FAQ


What is .Net Framework 3.0



The Microsoft .NET Framework 3.0 (formerly WinFX), is the new managed code programming model for Windows.

It combines the power of the .NET Framework 2.0 with four new technologies: Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), Windows Workflow Foundation (WF), and Windows CardSpace (WCS, formerly "InfoCard").

Use the .NET Framework 3.0 today to build applications that have visually compelling user experiences, seamless communication across technology boundaries, the ability to support a wide range of business processes, and an easier way to manage your personal information online. Now the same great WinFX technology you know and love has a new name that identifies it for exactly what it is – the next version of Microsoft’s development framework. This change does not affect the release schedule of the .NET Framework 3.0 or the technologies included as a part of the package.


Why is the .NET Framework 3.0 a major version number of the .NET Framework if it uses the .NET Framework 2.0 runtime and compiler?
The new technologies delivered in the .NET Framework 3.0, including WCF, WF, WPF, and CardSpace, offer tremendous functionality and innovation, and we wanted to signal that with a major release number.


Which version of the Common Language Runtime (CLR) does the .NET Framework 3.0 use?
The .NET Framework 3.0 uses the 2.0 version of the CLR. With this release, the overall developer platform version has been decoupled from the core CLR engine version. We expect the lower level components of the .NET Framework such as the engine to change less than higher level APIs, and this decoupling helps retain customers' investments in the technology.


Will the name change be reflected in any of the existing .NET Framework 2.0 APIs, assemblies, or namespaces?
There will be no changes to any of the existing .NET Framework 2.0 APIs, assemblies, or namespaces. The applications that you've built on .NET Framework 2.0 will continue to run on the .NET Framework 3.0 just as they have before.


How does the .NET Framework 3.0 relate to the .NET Framework 2.0?
The .NET Framework 3.0 is an additive release to the .NET Framework 2.0. The .NET Framework 3.0 adds four new technologies to the .NET Framework 2.0: Windows Presentation Foundation (WPF), Windows Workflow Foundation (WF), Windows Communication Foundation (WCF), and Windows CardSpace. There are no changes to the version of the .NET Framework 2.0 components included in the .NET Framework 3.0. This means that the millions of developers who use .NET today can use the skills they already have to start building .NET Framework 3.0 applications. It also means that applications that run on the .NET Framework 2.0 today will continue to run on the .NET Framework 3.0.


What happens to the WinFX technologies?
The WinFX technologies will now be released under the name .NET Framework 3.0. There are no changes to the WinFX technologies or ship schedule — the same technologies you're familiar with now simply have a new name.


What is the .NET Framework 3.0 (formerly WinFX)?
The .NET Framework 3.0 is Microsoft's managed code programming model. It is a superset of the .NET Framework 2.0, combining .NET Framework 2.0 components with new technologies for building applications that have visually stunning user experiences, seamless and secure communication, and the ability to model a range of business processes. In addition to the .NET Framework 2.0, it includes Windows Presentation Foundation (WPF), Windows Workflow Foundation (WF), Windows Communication Foundation (WCF), and Windows CardSpace.


System Requirements for Installing .NET Framework 3.0
Processor
Minimum: 400 megahertz (MHz) Pentium processor
Recommended: 1 gigahertz (GHz) Pentium processor

Operating System
.NET Framework 3.0 can be installed on any of the following systems:
Microsoft Windows 2003 Server Service Pack 1 (SP1)
Windows XP SP2
Windows Vista *

*Windows Vista comes with .NET Framework 3.0. There is no separate installation package required. The standalone .NET Framework 3.0 packages are not supported on Vista.

RAM
Minimum: 96 megabytes (MB)
Recommended:256 MB

Hard Disk
Up to 500 MB of available space may be required.
CD or DVD Drive Not required.

Display Minimum: 800 x 600, 256 colors
Recommended:1024 x 768 high color, 32-bit

Mouse Not required


What Improvements does WCF offers over its earlier counterparts?
A lot of communication approaches exist in the .NET Framework 2.0 such as ASP.NET Web Services, .NET Remoting, System.Messaging supporting queued messaging through MSMQ, Web Services Enhancements (WSE) - an extension to ASP.NET Web Services that supports WS-Security etc. However, instead of requiring developers to use a different technology with a different application programming interface for each kind of communication, WCF provides a common approach and API.


What are WCF features and what communication problems it solves?
WCF provides strong support for interoperable communication through SOAP. This includes support for several specifications, including WS-Security, WS-ReliableMessaging, and WS-AtomicTransaction. WCF doesn't itself require SOAP, so other approaches can also be used, including optimized binary protocol and queued messaging using MSMQ. WCF also takes an explicit service-oriented approach to communication, and loosens some of the tight couplings that can exist in distributed object systems, making interaction less error-prone and easier to change. Thus, WCF addresses a range of communication problems for applications. Three of its most important aspects that clearly stand out are:

Unification of Microsoft's communication technologies.
Support for cross-vendor interoperability, including reliability, security, and transactions.
Rich support for service orientation development.


What contemporary computing problems WCS solves?
WCS provides an entirely new approach to managing digital identities. It helps people keep track of their digital identities as distinct information cards. If a Web site accepts WCS logins, users attempting to log in to that site will see a WCS selection. By choosing a card, users also choose a digital identity that will be used to access this site. Rather than remembering a plethora of usernames and passwords, users need only recognize the card they wish to use. The identities represented by these cards are created by one or more identity providers. These identities will typically use stronger cryptographic mechanisms to allow users to prove their identity. With this provider, users can create their own identities that don't rely on passwords for authentication.


What contemporary computing problems WPF solves?
User interfaces needs to display video, run animations, use 2/3D graphics, and work with different document formats. So far, all of these aspects of the user interface have been provided in different ways on Windows. For example, a developer needs to use Windows Forms to build a Windows GUI, or HTML/ASPX/Applets/JavaScript etc. to build a web interface, Windows Media Player or software such as Adobe's Flash Player for displaying video etc. The challenge for developers is to build a coherent user interface for different kinds of clients using diverse technologies isn't a simple job.

A primary goal of WPF is to address this challenge! By offering a consistent platform for these entire user interface aspects, WPF makes life simpler for developers. By providing a common foundation for desktop clients and browser clients, WPF makes it easier to build applications.


What is XAML ?
WPF relies on the eXtensible Application Markup Language (XAML). An XML-based language, XAML allows specifying a user interface declaratively rather than in code. This makes it much easier for user interface design tools like MS Expression Blend to generate and work with an interface specification based on the visual representation created by a designer. Designers will be able to use such tools to create the look of an interface and then have a XAML definition of that interface generated for them. The developer imports this definition into Visual Studio, then creates the logic the interface requires.


What is XBAP?
XAML browser application (XBAP) can be used to create a remote client that runs inside a Web browser. Built on the same foundation as a stand-alone WPF application, an XBAP allows presenting the same style of user interface within a downloadable browser application. The best part is that the same code can potentially be used for both kinds of applications, which means that developers no longer need different skill sets for desktop and browser clients. The downloaded XBAP from the Internet runs in a secure sandbox (like Java applets), and thus it limits what the downloaded application can do.


What is a service contract ( In WCF) ?
In every service oriented architecture, services share schemas and contracts, not classes and types. What this means is that you don't share class definitions neither any implementation details about your service to consumers.

Everything your consumer has to know is your service interface, and how to talk to it. In order to know this, both parts (service and consumer) have to share something that is called a Contract.

In WCF, there are 3 kinds of contracts: Service Contract, Data Contract and Message Contract.

A Service Contract describes what the service can do. It defines some properties about the service, and a set of actions called Operation Contracts. Operation Contracts are equivalent to web methods in ASMX technology


In terms of WCF, What is a message?
A message is a self-contained unit of data that may consist of several parts, including a body and headers.


In terms of WCF, What is a service?
A service is a construct that exposes one or more endpoints, with each endpoint exposing one or more service operations.


In terms of WCF, What is an endpoint?
An endpoint is a construct at which messages are sent or received (or both). It comprises a location (an address) that defines where messages can be sent, a specification of the communication mechanism (a binding) that described how messages should be sent, and a definition for a set of messages that can be sent or received (or both) at that location (a service contract) that describes what message can be sent.

An WCF service is exposed to the world as a collection of endpoints.


In terms of WCF, What is an application endpoint?
An endpoint exposed by the application and that corresponds to a service contract implemented by the application.


In terms of WCF, What is an infrastructure endpoint?
An endpoint that is exposed by the infrastructure to facilitate functionality that is needed or provided by the service that does not relate to a service contract. For example, a service might have an infrastructure endpoint that provides metadata information.


In terms of WCF, What is an address?
An address specifies the location where messages are received. It is specified as a Uniform Resource Identifier (URI). The schema part of the URI names the transport mechanism to be used to reach the address, such as "HTTP" and "TCP", and the hierarchical part of the URI contains a unique location whose format is dependent on the transport mechanism.


In terms of WCF, What is binding?
A binding defines how an endpoint communicates to the world. It is constructed of a set of components called binding elements that "stack" one on top of the other to create the communication infrastructure. At the very least, a binding defines the transport (such as HTTP or TCP) and the encoding being used (such as text or binary). A binding can contain binding elements that specify details like the security mechanisms used to secure messages, or the message pattern used by an endpoint.


What is an operation contract?
An operation contract defines the parameters and return type of an operation. When creating an interface that defines the service contract, you signify an operation contract by applying the OperationContractAttribute attribute to each method definition that is part of the contract. The operations can be modeled as taking a single message and returning a single message, or as taking a set of types and returning a type. In the latter case, the system will determine the format for the messages that need to be exchanged for that operation.


What is a message contract?
A message contact describes the format of a message. For example, it declares whether message elements should go in headers versus the body, what level of security should be applied to what elements of the message, and so on.


What is a fault contract?
A fault contract can be associated with a service operation to denote errors that can be returned to the caller. An operation can have zero or more faults associated with it. These errors are SOAP faults that are modeled as exceptions in the programming model.


In Terms of WCF, what do you understand by metadata of a service
The metadata of a service describes the characteristics of the service that an external entity needs to understand to communicate with the service. Metadata can be consumed by the Service Model Metadata Utility Tool ( Svcutil.exe) to generate a WCF client and accompanying configuration that a client application can use to interact with the service.

The metadata exposed by the service includes XML schema documents, which define the data contract of the service, and WSDL documents, which describe the methods of the service.


What is password fatigue?
As the use of internet increases, as increases the danger of online identity theft, fraud, and privacy. Users must track a growing number of accounts and passwords. This burden results in "password fatigue," and that results in less secure practices, such as reusing the same account names and passwords at many sites.


What are activities in WWF?
Activities are the elemental unit of a workflow. They are added to a workflow programmatically in a manner similar to adding XML DOM child nodes to a root node. When all the activities in a given flow path are finished running, the workflow instance is completed.

An activity can perform a single action, such as writing a value to a database, or it can be a composite activity and consist of a set of activities. Activities have two types of behavior: runtime and design time. The runtime behavior specifies the actions upon execution. The design time behavior controls the appearance of the activity and its interaction while being displayed within the designer.


Related Links

Preventing Multiple Button Click on Asp.net Page

Preventing Multiple Button Click on Asp.net Page

Disabling a button until processing is complete

Here's the scenario - let's say you have an Insert subroutine, called 'doInsert'. You want to immediately disable the Submit button, so that the end-user won't click it multiple times, therefore, submitting the same data multiple times.

For this, use a regular HTML button, including a Runat="server" and an 'OnServerClick' event designation - like this:

<INPUT id="Button1" onclick="document.form1.Button1.disabled=true;" type="button" value="Submit - Insert Data" name="Button1" runat="server" onserverclick="doInsert">

Then, in the very last line of the 'doInsert' subroutine, add this line:

Button1.enabled="True"

Prevent Caching of WebPage in Asp.net

Prevent Caching of .aspx page

private void Page_Load(object sender, System.EventArgs e)

{

if(!Page.IsPostBack)

{

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Response.Cache.SetAllowResponseInBrowserHistory(false);

}

}

Page Redirect Code

Page Redirection Code

Note: Here i have used sample link www.dailyfreecode.com, but you can
replace with your homepage .html page.


<script language="JavaScript"><!--
window.location.href = "http://www.dailyfreecode.com";//-->
</script>

Fade Effect on Page Exit

Fade Effect on Page Exit

<meta http-equiv="Page-Exit" content="progid:DXImageTransform.Microsoft.Fade(duration=.9)">

Download .aspx file, Problem in displaying .aspx file

Download .aspx file, Problem in displaying .aspx file

You have developed and deployed a web application on a web server. When users are making a request to the default.aspx file on the web server from their browser, they are being prompted to download the default.aspx file on their computer. What could be the problem.

Problem with aspnet_isapi.dll

This behavior means that although the request is going to the IIS, it is not being executed by the asp.net worker process because IIS is not sure what to do with this file. This is because the aspnet_isapi.dll is either not present or IIS is not pointing to aspnet_isapi.dll.

RSS Feed on HTML Page

Display RSS Feed on your HTML Page

Use RSS To Javascript Converter

Click here for more Information


VS.Net Shortcut List

VS.net Keyboard Shortcut Keys

Shortcut Description
F3 Finds the next occurrence of the previous search text.
F5 Start debugging
F7 Jump to code behind file from .aspx files
F8 Moves the cursor to the next item, such as a task in the Task List window or a search match in the Find Results window. Each time you press F8, you move to the next item in the list.
F9 Toggle breakpoint
F12 Go to definition of identifier under cursor
Ctrl+F5 Start without debugging
Ctrl+F2 Jump to the Navigation Bar (hit TAB to get to the right side)
Ctrl+F3 Find word under cursor
Ctrl+TAB Toggle between windows in Visual Studio
Ctrl+I Incremental search (this is way better than Ctrl+F)
Ctrl+J Force IntelliSense for field members
Ctrl+C (with nothing selected) Copy whole line
Ctrl+Enter Open line above line cursor is on
Ctrl-X or Ctrl-L (with nothing selected) Cut whole line
Ctrl+] Bounce cursor between matching parentheses/brackets/braces
Ctrl+PageDown Toggle between Design and Source views in .aspx files
Alt+W, L Close all windows
Ctrl+K, Ctrl+C Comment out selection
Ctrl+K, Ctrl+U Uncomment selection
Ctrl+K, Ctrl+D Format document
Ctrl+K, Ctrl+X Insert snippet (or just type in the snippet name and hit TAB, TAB)
Ctrl+K, Ctrl+S Surround selected lines with snippet
Ctrl+K, Ctrl+K Toggle bookmark on/off
Ctrl+K, Ctrl+P Jump to previous bookmark
Ctrl+K, Ctrl+N Jump to next bookmark
Ctrl+M, Ctrl+M Open/close current fold
Ctrl+M, Ctrl+O Fold all methods
Ctrl+R, Ctrl+R Enables or disables word wrap in an editor.
Ctrl+Shift+B Build solution
Ctrl+Shift+C Displays the Class View window
Ctrl+Shift+Enter Open line below line cursor is on
Ctrl+Shift+F Global Search
Ctrl+Shift+F9 Delete all breakpoints
Ctrl+Alt+A Displays the Command window, which allows you to type commands that manipulate the IDE.
Ctrl+Alt+I Displays the Immediate window, where you can evaluate expressions and execute individual commands.
Ctrl+Alt+K Displays the Task List window where you customize, categorize and manage tasks, comments, shortcuts, warnings and error messages.
Ctrl+Alt+L Open the Solution Explorer (to find your file after you just closed them all)
Ctrl+Alt+T View Document Outline
Ctrl+Alt+0 Displays the Output window to view status messages at run time
Ctrl+Alt+R Open browser within VS.NET
Ctrl+Alt+U Displays the Modules window, which allows you to view the .dll or .exe files used by the program. In multiprocess debugging, you can right-click and select Show Modules for all Programs.
Ctrl+Alt+X Open Toolbox
Shift+Alt+Enter View editor in full screen mode
Source of Information

Friday, June 15, 2007

IIS Errors and Solution

  • Dynamic or Static Content Errors
  • Applications are denied access to resources
  • Requests for dynamic content return 404 error
  • Requests for static files return 404 error
  • Worker process recycling drops application session state
  • Server-side include directives (#include) return 404 error (for .stm files) or 0131 error (for .asp files)
  • ASP generates Permission Denied errors in event log for global.asa
  • CGI processes will not start
  • ASP.NET pages are returned as static files
  • Collaboration Data Objects for Windows NT Server fail
  • Connection Errors
  • Client requests receive 503 error
  • Anonymous accounts (IUSR_ computername) attempting sub-authentication logon receive 401 error
  • Clients cannot connect to server
  • UNC connections are denied access
  • Access denied to console applications in System32 directory
  • Client requests error-out or time-out
  • Miscellaneous Errors
  • File requests to UNIX or Linux server return wrong file or error
    Cannot locate /Scripts or /Msadc directory
  • ISAPI filter does not show up as "loaded" in UI

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/5d8a5d43-66f9-4185-8270-804d1dc4d4ca.asp

ASP.Net Server Controls Not Showing on pages

This problem might occur when you install IIS after visual studio, so to resolve this problem try registering “aspnet_isapi.dll” with following command on command prompt.

Note: comman path for aspnet_isapi.dll and aspnet_regiis.exe is

C:\windows\Microsoft.net\framework\v1.1.4322

Here v1.1.4322 is .Net Framework version.

C:\windows\Microsoft.net\framework\v1.1.4322> regsvr32 aspnet_isapi.dll

And Install asp.net server by following command

C:\windows\Microsoft.net\framework\v1.1.4322> aspnet_regiis.exe –i

SESSSION_END not firing

Code written in your Global.asax file for Session_End is not firing than it may be because of following conditions:

Cause 1: You are not using InProc Session Mode — The mode attribute of the element in your application Web.config file must be set to "InProc". If it isn't, the End event simply cannot fire.

Cause 2: You are not using Session — The Session End event can't fire if there's no Session to End. Check and make sure your application is storing information through the Session object?

Cause 3: Your code is imperfect — There might be error somewhere in the code that responds to the End event. For that you can try running your application in debug mode, with a short timeout attribute. Visit the page and then wait. Check whether the Session_End event fires? Check whether for any error occur in your code?

SqlException: Login failed for user '****\ASPNET'

You will get solution for this error on

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_21161621.html

Viewstate is Invalid for this Page

Because View State is stored in a hidden field on a Web page, it is vulnerable to tampering when data is being transferred between the client and the server. To help make View State more secure, ASP.NET validates View State to verify that it came from the correct page.

If ASP.NET cannot validate View State, ASP.NET returns a message to the client browser that states that "viewstate is invalid for this page and might be corrupted." However, the message does not describe why View State is not valid.
For More Information...
Click here,

http://support.microsoft.com/default.aspx?id=831150

http://www.extremeexperts.com/Net/FAQ/ViewStateisCorrupt.aspx

Login to SQL Server 2005 with Administration Privileges on Windows Vista OS

Login to SQL Server 2005 with Administration Privileges on Windows Vista OS you need to explicitly login as Administrator to perform administration task on sql server 2005 objects.



Look in figure for how to login explicitly as administrator privileges on windows vista OS


So now you can able to avoid many errors like Database creation, etc

Example:
Create failed for Database 'SampleDB'. (Microsoft.SqlServer.Smo)

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

CREATE DATABASE permission denied in database 'master'. (Microsoft SQL Server, Error: 262)

Asp.net Connectivity with SQL Server 2005

Asp.net Connectivity with SQL Server 2005

You will get number of queries on forums for connecting application to database. Most of time they are unable to connect because of incorrect connection string.

Step 1: Adding connection string code to web.config file

Syntax for connection string


<appsettings>
<add source="[ServerName]" value="" key="MyDBConnection">;Initial catalog =[dbname];user id=[username];password=[password];" />
</appsettings>

Example for connection string

Here, its an example of Windows Authentication Mode

<appsettings>
<add value="Data Source=SHRIGANESH-PC\SQLEXPRESS;Initial Catalog=firstdb;Integrated Security=True" key="conn">
</appsettings>


Step 2: Writing Code

Lets write code to display data in gridview.

private void BindGrid()
{
string sqlconn = ConfigurationManager.AppSettings["conn"].ToString();
SqlConnection conn = new SqlConnection(sqlconn);
SqlDataAdapter da = new SqlDataAdapter("select * from employee", sqlconn);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds.Tables[0].DefaultView;
GridView1.DataBind();
}


Solution for everyone, anytime

For all who are facing problem while connection application to backend, I would
suggest them to connect the application SqlDataSource Control and configure the
datasource through wizard, so that a misprint of character in your connection
string can be avoided and you can be on work without posting query on forum.


Finally Exception that you might face while connecting to .net application with sql server 2005 on windows vista operating system.

Asp.net connectivity with Sql Server 2005 is same as connecting to Sql Server
2000, but you can be put into trouble due to incorrect connection string and may
receive following error exception

The user is not associated with a
trusted SQL Server connection.

A connection was successfully
established with the server, but then an error occurred during the login
process.

To resolve the above error, check that connection string
you have used for connectivity is correct.

Share Point Interview FAQ

Interview FAQ on Share Point, You can find a huge collection of Share Point Interview FAQ here

http://www.spsfaq.com/general.asp

Thursday, June 14, 2007

Asp.net Debugging Errors and Solutions

Exception: The server does not support debugging of ASP.NET or ATL server applications.

If you have an XP Pro or W2K Pro machine, you may need to think about the order of installation between VS.net 7.0 and IIS. If you install IIS after VS.net 7.0, you will get this error. In this case, please register “aspnet_isapi.dll” with “aspnet_regiis.exe –i”.


Exception: Error while trying to run project: Unable to start debugging on the web server. The project is not configured to be debugged.

When trying to run/debug my ASP.Net web app from VS.NET (2003) I get this error:
Error while trying to run project: Unable to start debugging on the web server. The project is not configured to be debugged.

This was caused because I had renamed the virtual dir that the project resides in - and because of this IIS had decided to revert the dir from an application to a dir.

To resolve simply make it an app again via the IIS Management tool:
Within the IIS management tool, select your virtual dir.
Right-click and select Properties
In the Properties dialog box, click on the Create button.


Exception: Unable to start debugging on the web server

Your IIS application of IIS is not configured to use “integrated Windows authentication”. Please make sure that the “integrated windows authentication” checkbox on the “authentication method” dialog box is checked.


Exception: The project is not configured to be debugged.

You need to make sure that your web is configured for debugging. To do this, you need set “debug = true” in the “web.config” file. You may find this file in your web project folder.


Exception: Could not start ASP.NET or ATL server debugging.

You may have installed “IIS Lockdown” tool. If so, Please find “urlscan.ini” file, and add “DEBUG”(case sensitive) into “[allowverbs]” section in “urlscan.ini” file.


Exception: Access is denied.

You may be the member of “Debugger users” group, but you don’t have the right to debug the aspnet worker process, because you are not the “aspnet” user account or the member of “Administrators” group. Please add your user account to the “Administrators” group on the machine.


Exception: The debugger is not properly installed.

If you see this problem, please check debugging with console application project. And if the console application project shows the error message like

It means that your .Net framework is not installed properly. So you need to register “mscordbi.dll” manually by executing “regsvr32 mscordbi.dll”.


Exception: Do not have permission to debug the server

Problem 1: Make sure that “Integrated Windows Authentication” is enabled. Probably, you enabled only “Basic authentication” for Directory security of IIS.

Problem 2: If you are using “Integrated Windows authentication”, you need to make sure that your user account has full control on the directory of the IIS.

Problem 3: If you created the web project with a full machine name (like “machinename.domainname.something”), the web site is recognized as “Internet” site. So the default setting of IE will impact on the behavior of log on. In this case, you need to enable logging on with your current user account in “Internet” area with IE setting. But it is not the default setting of IE, so you’d be better off if you create project with only the machine name.


Breakpoint is not working, Can start debugging without error message, but breakpoints are not hit.

You started debugging with “F5” and it looks like debugging is started properly, and IE is launched properly. But you can’t hit a breakpoint on my code behind code.

Problem 1: Please make sure that “asp.net debugging” is enabled in the properties of project.

In the case of VB project, the UI is different. But you can recognize the equivalent one easily.

Problem 2: Please make sure that the expected DLL is loaded with matched debug symbol file. You can check it with “Modules” window.


Exception: Server side-error occurred on sending debug HTTP request.

Problem 1: Your web application doesn’t have an Application name. Please check the properties of the web project using the IIS MMC to ensure that your web project has an application name

You need to create an application name for debugging.

Problem 2: If you are using the NTFS file format, please make sure that “aspnet” has proper privilege on “wwwroot” or your folder for virtual directory to access and write on the folders.

Static "Members" and "Methods" of Class in .Net

Static Members of the class in .Net

Static members belong to the whole class rather than to individual object
Static members are accessed with the name of class rather than reference to objects.
Example of Static Mebers in .Net Class
class Test

{
public int rollNo;
public int mathsMarks;
public static int totalMathMarks;
}

class TestDemo
{
public static void main()
{
Test stud1 = new Test();
stud1.rollNo = 1;
stud1.mathsMarks = 40;
stud2.rollNo = 2;
stud2.mathsMarks = 43;
Test.totalMathsMarks = stud1.mathsMarks + stud2.mathsMarks;
}
}



Static Method of the class in .Net

1) Methods that you can call directly without first creating an instance of a class. Eg: Main() Method, Console.WriteLine()
2) You can use static fields, methods, properties and even constructors which will be called before any instance of the class is created.
3) As static methods may be called without any reference to object, you can not use instance members inside static methods or properties, while you may call a static member from a non-static context. The reason for being able to call static members from non-static context is that static members belong to the class and are present irrespective of the existence of even a single object.

Constructor Concept in .Net + Static Constructor concept and Example

Constructor
1) A constructor is a special method whose task is to initialize the object of its class.
2) It is special because its name is the same as the class name.
3) They do not have return types, not even void and therefore they cannot return values.
4) They cannot be inherited, though a derived class can call the base class constructor.
5) Constructor is invoked whenever an object of its associated class is created.
6) Note: There is always atleast one constructor in every class. If you do not write a
constructor, C# automatically provides one for you, this is called default constructor. Eg: class A, default constructor is A().


Static Constructor

In C# it is possible to write a static no-parameter constructor for a class. Such a class is executed once, when first object of class is created.
One reason for writing a static constructor would be if your class has some static fields or properties that need to be initialized from an external source before the class is first used.

Example of Static Constructor
Class MyClass

{

static MyClass()

{

//Initialization Code for static fields and properties.

}

}

Freeing Memory in .Net + Finalize Method + Destructor + Difference between Finalize and Destructor + Garbage Collection

.Net managed code enjoy's benefits of CLR, which automatically checks for object scope and if it is not referenced by any object than it is removed from memory.

But you can also manually frees memory....

Finalize() Method of Object class
Each class in C# is automatically (implicitly) inherited from the Object class which contains a method Finalize(). This method is guaranteed to be called when your object is garbage collected (removed from memory). You can override this method and put here code for freeing resources that you reserved when using the object.
Example of Finalize Method
Protected override void Finalize()

{

try

{

Console.WriteLine(“Destructing Object….”);//put some code here.

}

finally

{

base.Finalize();

}

}



Destructor

1) A destructor is just opposite to constructor.
2) It has same as the class name, but with prefix ~ (tilde).
3) They do not have return types, not even void and therefore they cannot return values.
4) destructor is invoked whenever an object is about to be garbage collected

Example of Destructor in .Net
class person

{

//constructor

person()

{

}



//destructor

~person()

{

//put resource freeing code here.

}

}



What is the difference between the destructor and the Finalize() method? When does the Finalize() method get called?

Finalize() corresponds to the .Net Framework and is part of the System.Object class. Destructors are C#'s implementation of the Finalize() method. The functionality of both Finalize() and the destructor is the same, i.e., they contain code for freeing the resources when the object is about to be garbage collected. In C#, destructors are converted to the Finalize() method when the program is compiled. The Finalize() method is called by the .Net Runtime and we can not predict when it will be called. It is guaranteed to be called when there is no reference pointing to the object and the object is about to be garbage collected.


Garbage Collection Concept

1) Garbage collection is the mechanism that reclaims the memory resources of an object when it is no longer referenced by a variable.
2) .Net Runtime performs automatically performs garbage collection, however you can force the garbage collection to run at a certain point in your code by calling System.GC.Collect().
3) Advantage of Garbage collection : It prevents programming error that could otherwise occur by incorrectly deleting or failing to delete objects.

Event Life Cycle in ASP.net Page Processing

When asp.net processes a web page, its event life cycle follows certain stages.

Importance of understanding Page Processing and different event occurs during it, will provide you better understanding of writing a code in proper event.

Imagine you have a page with a submit combo-box whose auto-postback property is true. Now whenever value of combo-box is changed a selectedIndex event is fired, but before that a series of other event fires.

For above scenario Event Life Cycle executes in following manner
1> Page.Init Event
2> Page.Load Event
3> Combo-box SelectedIndex Change Event
4> Page.PreRender Event
5> Page.Unload Event

This event life cycle will be proves to be blessing, when we are creating a dynamic control. For example in above case, lets assumed that whenever combo-box value changed we want to initialize certain control whose value based on combo-box selection. So how will you do it??? Answer is you can create dynamic controls in Page.Load Event and Initialize its value based on combo-box selection in Page.PreRender Event.


Functionality of Events

Page Initialization in Asp.net

Initialization of Page is been done, by creating a Instance of page. It is the best place to store initialization code related to page.
eg: VS.net uses Init event to attach event handler for other events.


Page Load Initialization in Asp.net

Initialization of controls of page is been done. It is best place to create dynamic controls, or initialize the controls.
eg: Creation of Dynamic Control


Page PreRender Event in Asp.net

This evnet occurs just before page is about to display. It is the best place to write code which requires to render based on value in controls.
eg: Initialization of dependent controls.

"value type" and "reference type" in .Net + Concept + Example

Value Type and Reference Type Concept in .Net

A variable is value type or reference type is solely determined by its data type.
Eg: int, float, char, decimal, bool, decimal, struct, etc are value types, while object type such as class, String, Array, etc are reference type.


Value Type

1) As name suggest Value Type stores “value” directly.
2) For eg:
//I and J are both of type int
I = 20;
J = I;
int is a value type, which means that the above statements will results in two locations in memory.
3) For each instance of value type separate memory is allocated.
4) Stored in a Stack.
5) It Provides Quick Access, because of value located on stack.



Reference Type

1) As name suggest Reference Type stores “reference” to the value.
2) For eg:
Vector X, Y; //Object is defined. (No memory is allocated.)
X = new Vector(); //Memory is allocated to Object. //(new is responsible for allocating memory.)
X.value = 30; //Initialising value field in a vector class.
Y = X; //Both X and Y points to same memory location. //No memory is created for Y.
Console.writeline(Y.value); //displays 30, as both points to same memory
Y.value = 50;
Console.writeline(X.value); //displays 50.
Note: If a variable is reference it is possible to indicate that it does not refer to any object by setting its value to null;
3) Reference type are stored on Heap.
4) It provides comparatively slower access, as value located on heap.


Note:
The behavior of strings is different, strings are immutable (unchangeable) if we alter a strings value, we create an entirely new string), so strings don’t display the typical reference-type behavior. Any changes made to a string within a method call won’t affect the original string.

Adding a Flash Movie in .aspx page

I have found a good article on Adding a Flash Movie in Asp.net page

Article explains you how to Embed Flash Animation in your web application

Click here

New Features in ASP.net 2.0

Summary of ASP.net 2.0 New Features

1. CLR Integration with SQL Server

2. New Validation Controls, Validation Groups

3. Improved Caching

4. More than 50 new controls like GridView, DetailsView which offer a seamless ease for displaying data with just a few clicks and configuration.

5. Personalization made easy as never before.

6. Website Administration and User Management made easier than before.

7. WebParts, MasterPages, Themes making Developer's life easier.

8. Extensibility for Mobile Rendering.

9. New features in C# such as Generics, Anonymous Methods.

More on ASP.net 2.0 New Features here

Visual Studio "Orcas" + Features of Orcas + Introduction to LINQ + Download Orcas CTP

Visual Studio "Orcas" is the next version of Visual Studio and this article provides a preview of the features and why it is compelling to work with.

Visual Studio "Orcas" The next version of Visual Studio is getting ready and stated for release later this year. Visual Studio "Orcas" presents unlimited capabilities and features which can make a developer's life more productive than ever.Lets have a peek into the list of features

Features of Visual Studio "Orcas"
.NET Framework 3.5 (includes support for 3.0, 2.0 versions) - You can write applications which target any of these versions and Visual Studio would automatically filter intellisense, toolbox controls, and add reference dialog items (among other things) to only show those features supported within that specific version of the framework. You can then compile against each of these different framework releases, as well as get full debugging support for each.

  • Extensions for Windows Workflow Foundation (Currently this can be downloaded separately for Visual Studio 2005 from here)
  • Windows SDK and .NET 3.0 Runtime Components (Currently this can be downloaded separately from here)
  • Extensions for WCF, WPF (Currently this can be downloaded separately from here)
  • ASP.NET AJAX 1.0 (Again, can be downloaded currently from here)All of the above, improved and with much more features and capabilties.
  • Expression Blend is specifically designed for thisSplit View of Design and CodeRich support for CSS .... and much much more.

LINQ Support One of the main things, I didnt mention is the support for LINQ. Will talk about it in a later post, but, it would definitely take programming languages to the next level of capabilities, what, with the support for querying Collections, Database and XML - all in the same way we are used to - SQL.

For More Features Check Scott Guthrie's post here.


Download Visual Studio "Orcas" The "Orcas" CTP can be downloaded from here It comes out it two forms, a pre-configured VPC as well as an individual tool download. It can work side by side with Visual Studio 2005.

Profile in asp.net 2.0 + Problem with Session + Differences between Session and Profile objects + Advantage of Profile Object

All of us who write web application enforce some mechanism by which we store a user's information for the period he is accessing the application. This may be from simply storing the User's ID to say a Welcome to maintaining his preferences, shopping cart etc.,
Session Object - the Session object has been pretty useful to accomplish this task. With Whidbey (ASP.NET 2.0), there is a new feature Profile which allows us to store per-user settings to be used throughout the application. Settings can also be stored in an anonymous profile while users are not logged in, and then migrated to a logged-in user profile at a later time.

Differences between Session and Profile objects
The major difference between Profile and Session objects are1. Profile object is persistent whereas Session object is non-persistant.2. Profile object uses the provider model to store information whereas Session object uses the In Proc, Out Of Process or SQL Server Mode to store information.3. Profile object is strongly typed whereas Session object is not strongly typed.The similarity between them is that Each user will automatically have a profile of his own similar to Sessions where each user will have his own Session State.

Profile Object
Examining the Profile objectA user's profile is a collection of properties that define information you want to store for your web site's users. The user's profile is defined using a simple XML syntax in a configuration file (machine.config and/or web.config). Within your page, you reference a user's profile information with the Profile property. ASP.NET reads the schema defined in configuration, and automatically generates a class that is accessible from the Profile property on a page. You access properties on the Profile just as you would access properties on any other class.

The most common use of the Profile feature is storing data for authenticated users, the Profile feature also supports storing information for anonymous users. Storing profile information for anonymous users depends on the Anonymous Identification feature. The Profile and Anonymous Identification features work together to enable the use of the Profile property for anonymous users. The samples included in the QuickStart demonstrate using the Profile feature with both authenticated and unauthenticated users. Prior to the start of the page lifecycle, ASP.NET ensures that the Profile is available for use by the page. Similarly, at the end of the ASP.NET page lifecycle, ASP.NET automatically saves the Profile to the underlying data store(s). As with other features such as Membership and Role Manager, the Profile feature has been designed with a provider-based model. Providers abstract the physical data storage for a feature from the classes and business logic exposed by a feature. The Profile feature ships with a provider for Microsoft™ SQL Server. You can create your own custom providers and configure them to work either the Profile feature. Pages that use the Profile feature will continue to work unchanged with your custom providers.

In addition to the Profile property, the Profile feature provides support for administration of profiles (both for authenticated users and anonymous users) with the ProfileManager. Common tasks that you perform with the ProfileManager include:

  • Searching for statistical information about all profiles, profiles for authenticated users, and profiles for anonymous users
  • Determine the number of profiles that have not been modified in a given period of time
  • Deleting individual profiles as well as deleting multiple profiles based on a profile's last modification date

Tuesday, June 12, 2007

Indian Programming Guru

I was searching for a Programming Guru and was surprise with result in Google, I have been sort on front page of google for Indian Programming Guru. Well for me its a moment of responsibility to retain this result forever.



Monday, June 11, 2007

What is Windows Workflow Foundation (WF)

What is Windows Workflow Foundation (WF)

  • WF is a tool for building workflow enabled applications on windows.
  • The Windows Workflow Foundation namespace in Microsoft .NET Framework is called System.Workflow. Windows Workflow Foundation provides a consistent and familiar development experience with other Microsoft .NET Framework technologies such as ASP.NET, Windows Communication Foundation and Windows Presentation Foundation. Windows Workflow Foundation provides full support for Visual Basic .NET and C#, debugging, a graphical workflow designer and the ability to develop your workflow completely in code. Windows Workflow Foundation also provides an extensible model and designer to build custom activities which encapsulate workflow functionality for end-users or for re-use across multiple projects.
  • WF provides a flexible flow model for various types of workflow:
  • Sequential workflow in which one task is executed after another
  • State machine workflow in which external events drive the flow
  • Rule-driven workflow in which a set of rules in combination with the state of data drive the order of processing.

Advantage of Workflow Technology
Workflow technology provides abstractions convenient to describe real world scenarios

Resources for WF

Community Site for Windows Workflow (WF)

Related Links
Microsoft .NET Framework 3.0
Windows Presentation Foundation (WPF)
Windows Communication Foundation (WCF)
Windows Workflow Foundation (WF)

What is Windows Communication Foundation (WCF)

What is Windows Communication Foundation (WCF)

  • WCF is a new framework for building distributed applications.
  • It enables developers to build secure, reliable service-oriented applications that integrate across platforms and interoperate with existing investments.
  • WCF solutions can run within the context of a single machine, over company intranets, or across the Internet using a variety of protocols, formats, and message exchange patterns.
    By combining and extending the capabilities of existing Microsoft distributed systems technologies (Enterprise Services, System.Messaging, .NET Remoting, ASMX, and WSE), WCF reduces the coding and complexity of developing, deploying and managing distributed applications.
  • WCF provides you with a unified programming model that brings together the best aspects of existing Microsoft technologies.
  • What this means is that, with WCF, you will no longer need to wonder “which technology do I use (ASMX, Remoting, etc)” when building a connected system. All of the application-to-application and intra-application communication for your connected will be handled by WCF. This unified programming model is exposed to you through the System.ServiceModel namespace.

Related Links
Microsoft .NET Framework 3.0
Windows Presentation Foundation (WPF)
Windows Communication Foundation (WCF)
Windows Workflow Foundation (WF)

Most Recent Post

Community Updates

Subscribe Blog via Email

Enter your email address:



Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.
Page copy protected against web site content infringement by Copyscape