WCF Fundamentals and Quick start

Challenge:

After receiving lot of appreciation and positive comments on my first WCF article Why we need Windows Communication Foundation? and suggestion from Manaday (Which was going back of my mind. But somehow I was not bringing it in implementation), Henceforth I am going to post full WCF Series based on last fictional story.
So, here’s the 2nd part of WCF Story where our architect would like to share his WCF Fundamentals with you!

Solution:

Architect was kind enough to share his WCF Fundamental notes what he created for his team with you! [We should be thankful to him :)]
WCF provides API for creating systems that send messages between clients and services. Which can be sent either Intranet or Internet over TCP,HTTP,MSMQ, Web Services etc. Also it’s Interoperable!

Following are most of the concepts and terms used in WCF:

  • Message: Self-contained packets of data that may consist of several parts including header and body. All parts of a message can be encrypted and digitally signed except for the header which must be in clear text.
  • Service: A software module (EXE or DLL) that provides 1 to n endpoints with each endpoint providing 1 to n service operations.
  • Endpoint: A single interface that is used to establish communications between clients and hosts. Each endpoint has its own address that is appended to the base address of the service, making it a unique entity. A WCF service is a collection of endpoints.
  • Binding: A set of properties that define how an endpoint communicates with the outside world. At the very least, the binding defines the transport (HTTP or TCP) that is necessary to communicate with the endpoint. A binding may also specify other details such as security or the message pattern used by the endpoint.
  • System-provided bindings: A collection of bindings that are optimized for certain scenarios. For example, WSHttpBinding is designed for interoperability with Web Services that implement various WS-* specifications.
  • Service Contract: The contract defines the name of the service, its namespace, and other global attributes. In practice, a contract is defined by creating an interface (interface in C#) and applying the [ServiceContract] attribute. The actual service code is the class that implements this interface.
  • Operation Contract: Given that a service contract is defined by creating an interface and annotating it with [ServiceContract], an operation contract is a member method of that interface that defines the return type and parameters of an operation. Such an interface method must be annotated with [OperationContract].
  • Data Contract: Data types used by a service must be described in metadata to enable clients to interoperate with the service. The descriptions of the data types are known as data contracts and the types may be used in any message (parameters or return types).
  • Service operation: A method that is implemented and exposed by a service for consumption by any client. If a service contract is defined by creating an interface, then a service operation is the class that implements this interface.The method may or may not return a value, and may or may not take any arguments. Note while a method invocation might appear as a single operation on the client, it can result in sending multiple messages to the service. For example, a method with two arguments called on a WCF client results in two messages sent to the service.
  • Host: A host is an application (typically .exe) that is used to control the lifetime of a service. A host can be a console, a Windows Service, a Window Activation Service (WAS) and Internet Information Service (IIS) among others. For IIS, you can set a virtual directory that contains the service assemblies and configuration file. When a message is received, IIS starts the service and control its lifetime. When a client (or clients) end(s) the session, IIS closes the application and releases it resources.
  • Behavior: A behavior is a type (i.e., class) that augments the runtime functionality of a service. Service behaviors are enabled by applying a [ServiceBehavior] attribute to a service class and setting properties to enable various behaviors. Behaviors are used to control various runtime aspects of a service or endpoint. Behaviors are grouped according to scope: Common behaviors affect all endpoints, service behaviors affect only service-related aspects, and endpoint behaviors affect only endpoint-related properties. For example, an endpoint behavior may specify where and how to find a security credential.
  • Instancing: A service has an instancing model which controls how many instances of the service can run at one time. There are four instancing models: single, per call, per session, and shareable. The first two are similar in concepts to the Singleton and Single Call SAOs in .NET Remoting. Instancing is a behavior and and as such it is specified as part of the [ServiceBehavior] attribute as follows: [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)].
  • Client Application: A program that exchanges messages with one or more endpoints. The client application typically creates a WCF Client Object and then calling methods on this proxy object.
  • Channel: This is the transport connection between a client application and an endpoint in a service. A client uses a transport (TCP, HTTP, etc.) and an address to construct a channel to a specific endpoint.
  • WCF Client Object: This a client-side construct that encapsulates service operations as methods, in other words, a WCF Client Object is a proxy to the service methods. Note that any application can host a WCF Client Object, even an application hosting a service. Therefore, it is possible to create a service that includes and uses proxies to other services. These proxies are typically generated using the svcutil.exe command-line utility.
  • Metadata: data that is generated by the svcutil.exe command-line utility. This data includes:
  1. XML schema that define the data contract of the service.
  2. WSDL to describe the methods of the service.
  3. Application configuration files.
  • Metadata exchange point: An endpoint with its own address that is used to publish metadata.
  • Security: Security in WCF includes encryption of messages, integrity of messages, authentication and authorization. These functions can be provided by either using existing security mechanisms such as HTTPS or by implementing one or more of the various WS-* security specifications.
  • Message pattern: The message pattern determines the relationship and direction of messages between the client and the service. The most basic pattern is the one-shot (or one way) pattern is which a message is sent to the server but not response is expected. The most complex pattern is a dual HTTP pattern where two HTTP channels are constructed between a client and a service, with both sides invoking operations on each other.
  • Reliable messaging: The assurance that a message is received only once and in the order in which it was sent.
  • Sessions: A session is used to establish communication between a client and a service in which all messages are tagged with an ID that identifies the sessions. If a session is interrupted, it can be restarted with the session ID. If a service contract supports a session, then you will need to use Instancing to determine how the class that implements the service contract behaves during the session. See the Duplex Message Pattern example in Designing Contracts chapter.

Basic WCF Programming Lifecycle

Here are the basic steps of WCF Programming Lifecycle – Order matters!

  1. Define the service contract. A service contract specifies the signature of a service, the data it exchanges, and other contractually required data.
  2. Implement the contract. To implement a service contract, create the class that implements the contract and specify custom behaviors that the runtime should have.
  3. Configure the service by specifying endpoint information and other behavior information.
  4. Host the service in an application.
  5. Build a client application.

Just a note : Although the topics in this section follow this order, some scenarios do not start at the beginning. For example, if you want to build a client for a pre-existing service, you start at step 5. Or if you are building a service that others will use, you may skip step 5.

WCF Quick start

Following steps will help you to create your first WCF service (In this example we are going to create two console applications one console application will be hosting the service and second one will be consuming the service):
Step 1 : Define a Windows Communication Foundation Service Contract : When creating a basic WCF service, the first task is to create the contract for the service that is shared with the outside world that describes how to communicate with the service. This contract specifies the collection and structure of messages required to access the operations offered by the service. This is done by creating an interface that defines the input and output types, which apply the ServiceContractAttribute to the interface and OperationContractAttribute to the methods that you want to expose.

NOTE : We need to add reference to System.ServiceModel

The service contract that is used here employees a request-reply message exchange pattern by default that is not explicitly specified. You can specify this and other message exchange patterns for client-service communications by setting properties of the OperationContractAttribute and ServiceContractAttribute in the contract.
Example:
[sourcecode language=”csharp”]
namespace WCFService
{
[ServiceContract]
public interface ICalculator
{
// It will be exposed to clients
[OperationContract]
double Add(double number1, double number2);
}
}
[/sourcecode]
Step 2 : Implement a Windows Communication Foundation Service Contract : Implement the Service Contract defined in step1.
Example:
[sourcecode language=”csharp”]
namespace WCFService
{
public class CalculatorService : ICalculator
{
#region ICalculator Members
public double Add(double number1, double number2)
{
Console.WriteLine("Service called at : {0}", DateTime.Now.ToString());
Console.WriteLine(@"Calculator Service got called
with two parameters {0} and {1}",
number1,
number2);
double result = number1 + number2;
Console.WriteLine("The result is : {0}",result);
Console.WriteLine("——————————-");
return result;
}
#endregion
}
}
[/sourcecode]
Step 3 : Run a Basic Windows Communication Foundation Service :
This topic describes how to run a basic Windows Communication Foundation (WCF) service. This procedure consists of the following steps:

  • Create a base address for the service.
  •  Create a service host for the service.
  •  Enable metadata exchange.
  •  Open the service host.

Example:
[sourcecode language=”csharp”]
namespace WCFService
{
class Program
{
static void Main(string[] args)
{
// Address
Uri baseAddress =
new Uri("http://localhost:8080/WCFService/Service");
// Host
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService),
baseAddress);
try
{
// Binding, Contract
serviceHost.AddServiceEndpoint(typeof(ICalculator),
new WSHttpBinding(),
"CalculatorService");
// Metadatabehavior
// WSDL information we need to expose to clients
// it works on HTTP GET Method
ServiceMetadataBehavior serviceMetadatabehavior
= new ServiceMetadataBehavior();
serviceMetadatabehavior.HttpGetEnabled = true;
serviceHost.Description.Behaviors.Add(serviceMetadatabehavior);
// Start the service
serviceHost.Open();
Console.WriteLine("Service started : {0}",
DateTime.Now.ToString());
// Stop the service
Console.WriteLine("Press ENTER to shut down the service");
Console.ReadLine();
serviceHost.Close();
Console.WriteLine(@"Service shutdown successfully.
Thank you for using our service!");
}
catch (CommunicationException ce)
{
Console.WriteLine(ce.Message);
serviceHost.Abort();
}
}
}
}
[/sourcecode]
Step 4: Create a Windows Communication Foundation Client : This topic describes how to retrieve metadata from a WCF service and use it to create a proxy that can access the service. This task is most easily completed by using the ServiceModel Metadata Utility Tool (Svcutil.exe) provided by WCF. This tool obtains the metadata from the service and generates a managed source code file for a client proxy in the language you have chosen. In addition to creating the client proxy, the tool also creates the configuration file for the client that enables the client application to connect to the service at one of its endpoints.

svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config

By default, the client proxy code is generated in a file named after the service (in this case, for example, CalculatorService.cs or CalculatorService.vb where the extension is appropriate to the programming language: .vb for Visual Basic or .cs for C#). The /out switch used changes the name of the client proxy file to “generatedProxy.cs”. The /config switch used changes the name of the client configuration file from the default “output.config” to “app.config”.

Just a note : If you would like to test your service quickly. You can use WCFTestClient.exe utility which will help you to test your service without writing a single line of code for your WCF Client!


Step 5: Configure a Basic Windows Communication Foundation Client : This topic adds the client configuration file that was generated using the Service Model Metadata Utility (Svcutil.exe) to the client project and explicates the contents of the client configuration elements. Configuring the client consists of specifying the endpoint that the client uses to access the service. An endpoint has an address, a binding and a contract, and each of these must be specified in the process of configuring the client.
svcutil.exe will provide you the default configuration automatically.
Step 6 : Use a Windows Communication Foundation Client : Once a Windows Communication Foundation (WCF) proxy has been created and configured, a client instance can be created and the client application can be compiled and used to communicate with the WCF service. This topic describes procedures for creating and using a WCF client. This procedure does three things: creates a WCF client, calls the service operations from the generated proxy, and closes the client once the operation call is completed.
Now, copy paste the svcutil generated files (CS and Config file) within your console project and then you can call your service from your client application as shown below:
Example:
[sourcecode language=”csharp”]
namespace WCFClient
{
class Program
{
static void Main(string[] args)
{
CalculatorClient calculatorClient = new CalculatorClient();
Console.WriteLine("Proxy calling service…");
Console.WriteLine(calculatorClient.Add(10, 20));
// Good practice
calculatorClient.Close();
Console.WriteLine("closed!");
}
}
}
[/sourcecode]
And then first start your service (your service must be in running state before you run the client) and then run the client. And this is how it will look like:

Resources

Mike Taulty’s Video : Windows Communication Foundation:” Hello World”:
http://go.microsoft.com/?linkid=4091084
http://download.microsoft.com/download/f/b/3/fb3c2a8b-604e-479b-ab22-e31dc094a40d/WCF_Hello_World.zip
Stay tuned for next story! (Just a note : If you would like to get email update whenever new story get posted, please do subscribe using subscription form — given right side) 🙂
Happy WCF Programming! 🙂

Why we need Windows Communication Foundation?

Challenge:

In earlier days, when i was totally newbie to WCF, I was not clear why we need WCF? one thing I was clear that it has something to do with Web Services. But other than that nothing was much clear.
Then at one fine day, I came across Shivprasad Koirala’s .NET Interview questions book. In which he explained why we need WCF and what is WCF using a fictional story. It is really nicely written and it clears why we need WCF.
Before couple of days, I got good time (as I was on holidays) to convert that story in a comic — To make it more funny (And that’s what philosophy I follow — “Coding should be fun” :-)) and comic blog — a new concept which I always wanted to start!
So, here we go my first comic blog article which explains why we need WCF?

Solution:

  • Long Long time ago there lived a hardworking and a nice architecture.
  • Develop a Booking Engine which books tickets for any flight carriers.
  • The nice and hardworking architecture and his team developed a nice booking engine by which you can book tickets through any of the flight Carriers. The Travel Agent Company was very happy with the architecture and his team Member’s achievements.

  • As time passed by the travel agent’s business grew in multiples
  • Architecture and his team was very excited and they started to work on this new stuff
  • All franchises run on Windows Platform.
  • Booking engine was located in the main head office and all the franchise should communicate to this booking engine.
  • After months he rolled out his project successfully.

  • Time passed by and because of the good automated booking service more companies wanted to take the franchise from the travel agent. But the big issue was many of the franchise did not have windows operating system. They worked on Linux and other Non-Microsoft operating systems.
  • Due to this limitation travel agent was losing lot of franchise business.
  • Now, booking engine runs on two platforms .NET Remoting (for Windows based clients) and Web Services (for non-windows based clients).

  • Franchise client had to wait to get response and was not able to process the next ticket booking until the first one was served. Travel Agent started receiving huge complaints because of this synchronous processing.
  • Booking engine had the capacity of serving 20 tickets / second but it had now to serve 50 tickets / second.
  • when the travel agent makes a booking it will come and fall in the queue and release the travel agent. Booking engine will always poll for this queue. When the booking engine finishes he will publish the booking results back to the queue. Travel agent client can then come at his leisure and see the results.

  • Everyone in the travel company was really happy and impressed by the architect and his team members
  • Travel Agent then felt a huge necessity of a good security model with the booking engine.

  • Till now the travel agent was booking one ticket at a time. But soon he started getting lot of orders to book group family tickets.
  • Consistency – If father’s ticket gets canceled. Kid’s ticket should also be got canceled.


They were working on:

  • .NET
  • .NET Remoting
  • Web Services
  • MSMQ
  • WSE
  • COM+


WCF is a unification of all distributed technologies like:

  • .NET Remoting
  • MSMQ
  • Web Services
  • COM+

Thanks a lot Shivprasad Koirala for writing such a nice story!
Happy Coding! 🙂

Presentation on coding standards and best programming practices

Challenge:

Luckily, I got sometime to come back on this blog and share something with you!
After getting bit experience, making few mistakes [and obviously learning from them] I thought to write an article on coding standards and best programming practices, I know few of you say there are the lot of articles available on web from big guns on this topic. And I agree with you. But all of them are “document” and I’ve penned down “presentation” which shares the best practices in a lighter way! and obviously “reading document” sounds bit boring and “reading presentation” sounds bit interesting and fun! That’s what I think “Coding should be fun!” 🙂
I had started working on this article, and revised it so many times, got it reviewed from friends, got their feedback and included it in the document. Initially planned to give this presentation to audience in person. But due to one or other reasons this idea didn’t work. PPT was ready and was lying in my folder since so long. Today, I thought that I should share it here. So, It will be available to larger audience.

Solution:

It covers following topics:

  • Naming Conventions and Standards
  • Indentation, spacing and comments
  • Coding Best Practices
  • Database Best Practices
  • ASP.NET Best Practices
  • Exception Handling and Logging
  • Visual Studio IDE Tips and Tricks

You can download it from following links:
C# Coding Standards And Best Programming Practices (PDF)
C# Coding Standards And Best Programming Practices (PPT)
Also you can have a quick look from below and if you find it interesting then only you can download 🙂
PPT
[scribd id=62747117 key=key-2d4x58u7dizv46r6u1mt mode=list]
PDF
[scribd id=62748045 key=key-9ym8vluqb0fcxwz5ovc mode=slideshow]
Thanks to all of them who provided their invaluable suggestions, feedback, and helped me to proof read this PPT.
Eager to listen your views/suggestions/comments/feedback.
If you really liked it, then please spread it. So, it will be beneficial to everyone!
Happy Coding! 🙂

Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occured because all pooled connections were in use and max pool size was reached.

Challenge:

Have you seen following error?
timeout-expired-the-timeout-period-elapsed-prior-to-obtaining-a-connection-from-the-pool-this-may-have-occured-because-all-pooled-connections-were-in-use-and-max-pool-size-was-reached
Then this post is to solve it!

Solution:

As per the error your code has not closed the opened SqlConnection properly. For example
SqlConnection conn = new SqlConnection(

myConnectionString);
conn.Open();
doSomething(); /*  If some error occurs here — Next line will not get called and it will leave connection open */
conn.Close();
Solution:
1.
SqlConnection conn = new SqlConnection(myConnectionString);
try
{
conn.Open();
doSomething(conn);
}
finally
{
conn.Close();    // This line will get called in any case — success/failure
}
So, open your solution in Visual Studio and search in entire solution for all open connections and for all the code implement above suggested solution.
Just a note : If you have written Data Access layer code in code behind file then you are in trouble here. You have to do changes at N number of places. If you would have created separate Data Access layer (Technically Class Library) and Method to do DB operation then your task would have been easy enough!
2) You can raise the connection pool size in the connection string.  For example, you can add “Max Pool Size=100” to your connection string to increase the pool size to 100.
Implement above solutions. You should not see any issues any more.
Good to read :
http://blogs.msdn.com/b/tolong/archive/2006/11/21/max-pool-size-was-reached.aspx
Happy DB Access! 🙂

ASP.NET Session with proxy server

Challenge:

Y’day I came across with nice issue. Basically there is one Web Application developed using ASP.NET and deployed on IIS Server. Now, this application will be accessed by more than 2-3 people from Local area network. So, far so good.
This application uses Session and here issue comes — For all users across different machines were getting access of different persons session data — which should not be the case. Because as per theory “session” is unique for each user. But my dear friend theory is theory in real life you have to face lots of challenges like this. 🙂

Solution:

So, I jumped in to this issue and first tried to understand what is going on [The basic stuff — which I always do!].
To quick check the Session ID and other Session related information. I decided to code one page which will print my session info on page and it should show me some direction. I opened my favorite tool — Visual Studio and added one page using single file model — which I can deploy easily on server.
The code looks like below:
<%@ Page Language=”C#” AutoEventWireup=”true” %>
<%@ Import Namespace=”System” %>
<!–DOCTYPE html PUBLIC “/-/W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
xmlns=”http://www.w3.org/1999/xhtml”>
<script language=”C#” runat=”server”>
// new line
private const string breakLine = ”
“;
// Strong Start
private const string strongStart = ““;
// Strong End
private const string strongEnd = “”;
private const string sessionTimeKey = “SessionTime”;
protected void Page_Load(object sender, EventArgs e)
{
// generate string with all required information
StringBuilder sessionInformation = new StringBuilder();
if (Session[sessionTimeKey] == null)
// Current Time
Session[sessionTimeKey] = DateTime.Now;
// IsCookieless
sessionInformation.Append(strongStart);
sessionInformation.Append(“IsCookieless : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Session.IsCookieless.ToString());
sessionInformation.Append(breakLine);
// IsNewSession
sessionInformation.Append(strongStart);
sessionInformation.Append(“IsNewSession : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Session.IsNewSession.ToString());
sessionInformation.Append(breakLine);
// Session.Keys.Count
sessionInformation.Append(strongStart);
sessionInformation.Append(” Total Keys Count : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Session.Keys.Count.ToString());
sessionInformation.Append(breakLine);
// Mode
sessionInformation.Append(strongStart);
sessionInformation.Append(” Session Mode : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Session.Mode.ToString());
sessionInformation.Append(breakLine);
// SessionID
sessionInformation.Append(strongStart);
sessionInformation.Append(” SessionID : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Session.SessionID);
sessionInformation.Append(breakLine);
// Timeout
sessionInformation.Append(strongStart);
sessionInformation.Append(” Timeout : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Session.Timeout.ToString());
sessionInformation.Append(breakLine);
// Session Value
sessionInformation.Append(strongStart);
sessionInformation.Append(” Session Value(DateTime) : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Convert.ToString(Session[sessionTimeKey]));
sessionInformation.Append(breakLine);
// SERVER_NAME
sessionInformation.Append(strongStart);
sessionInformation.Append(” SERVER_NAME : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Request.ServerVariables[“SERVER_NAME”]);
sessionInformation.Append(breakLine);
// SERVER_PORT
sessionInformation.Append(strongStart);
sessionInformation.Append(” SERVER_PORT : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Request.ServerVariables[“SERVER_PORT”]);
sessionInformation.Append(breakLine);
// LOCAL_ADDR
sessionInformation.Append(strongStart);
sessionInformation.Append(” LOCAL_ADDR : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Request.ServerVariables[“LOCAL_ADDR”]);
sessionInformation.Append(breakLine);
// REMOTE_ADDR
sessionInformation.Append(strongStart);
sessionInformation.Append(” REMOTE_ADDR : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Request.ServerVariables[“REMOTE_ADDR”]);
sessionInformation.Append(breakLine);
// REMOTE_HOST
sessionInformation.Append(strongStart);
sessionInformation.Append(” REMOTE_HOST : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Request.ServerVariables[“REMOTE_HOST”]);
sessionInformation.Append(breakLine);
// SERVER_NAME
sessionInformation.Append(strongStart);
sessionInformation.Append(” SERVER_NAME : “);
sessionInformation.Append(strongEnd);
sessionInformation.Append(Request.ServerVariables[“SERVER_NAME”]);
sessionInformation.Append(breakLine);
Response.Write(sessionInformation.ToString());
sessionInformation.Append(breakLine);
Response.Write(“———-SESSION CONTENT——————-“);
Response.Write(breakLine);
foreach (string item in Session.Contents)
{
if (Session[item] != null)
{
Response.Write(string.Format(“Key :{0} – Value : {1}”,
item,Convert.ToString(Session[item])));
Response.Write(breakLine);
}
}
}
protected void btnRefresh_Click(object sender, EventArgs e)
{
Response.Redirect(Request.Url.ToString());
}
</script>
<head runat=”server”>
<title>Session Check Page</title>
</head>
<body>
<form id=”form1″ runat=”server”>
<div>
<asp:Button ID=”btnRefresh” runat=”server” Text=”Refresh” OnClick=”btnRefresh_Click” />
</div>
<br />
</form>
</body>
</html>
Basically, this page is my favorite page. Before a year using this page’s code only. I fixed one Live issue [Sticky Session was of on Load balancer on our web farm environment]. If you see the code of page it is quite simple. But very useful!
What I check there is Session ID, LOCAL Address and Session value which I store on page load’s not postback only. And it has one nice button called “Refresh” which redirects on same page.
We deployed this page on Server and started accessing it from different – different machines. And we started clicking on “Refresh” button which shown us few strange thing as below:
1. SessionID was changing on each Refresh button’s click – This should not be the case. Because Session ID will be unique till session expires or user closes the browser.
2. Session’s value was also changing on each refresh.
3. REMOTE_ADDR was coming same on 2-3 machines.
Now, we started removing possibilities one by one.
For issue#1 — We checked Web.Config and found that StateNetworkTimeout property has been assigned, frankly it should not cause an issue. But we thought better to remove it. So, we removed it.
#2 ,#3 – Then we realized that we are using Proxy on our LAN and REMOTE_ADDR’s IP address was IP Address of proxy server.
So, we found that Proxy is causing us an issue. To resolve it we removed proxy server’s setting from Internet explorer’s settings for few machines from which we need to access this application.
Isn’t it simple?
Happy Coding! 🙂

1,50,000 blog hits and growing

I still remember my 1,00,000 hits blog which I wrote on 23rd August 2011. And today Just saw that we crossed 1,50,000 blog hits and this not an end this is just beginning because I know that you — my blog readers – will keep visiting, reading, and sharing my blog. Thanks to each and every visitor for contributing in to this count so all credit goes to you! — Thank you again!

1,50,000 Hits
1,50,000 Hits

I remember that I’ve started blogging from December 2007 and till today I’m learning how to write a good blog — yeah agree that each and every day I’ve learnt a lot!

One thing which motivates me a most to keep my blog alive and writing tirelessly, Is people’s comments. When I check the comments people says “Oh man you saved my day”, “Thank you”. Frankly speaking it stimulates a lot. It absorbs all my day’s tiredness and inspires me to write one new blog 🙂 [So, If you like anything — not only on my blog or virtual world. I am talking about all aspects. Then don’t forget to appreciate it!]. Some comments I would like to share with you:

THANK YOU THANK YOU! Days of Tracking down solution NONE WORKED!!! EXCEPT

YOURS! This is was a great Help. Thank you Very Much. Even Microsofts sight, did not have this solution for this probolem….like that is a surprise!

Thank god there are people like you. And of course all you others that came here as me…

Thnaks

/Ralf

Thanks a lot it worked for me… :)

thank you ,it’s helped me alot

wow…life is truely an enjoyable mystery sometimes(with a few bumps/challenges here and there). I got your link from an email one of our developers sent another programmer. I saw what the conversation was about so I followed the link (I also do some programming). After reading a few of your posts and your comments, I was truely impressed with your spirit. Aside from programming, it was nice to stumble upon your site and to walk away with a few tid-bits of inspiration…code, life. In this world today, we all need to remind each other of gratitude, thankfulness, and yes, happiness. Thank you my friend for letting your heart shine.

Thanks for the tip…

really helped me.I also want to do a similar thing. and it works fine

Thank you, this was driving me nuts and changing to a dataset finally gotit working. Awesome!

You, my friend, are a god-send. This is exactly the fix I needed. I’ve spent a couple days trying to get my vbs files to work and was about to give up and rebuild this XP machine.

Thank you.

Thanks Kiran..!

The solution rele worked..

After searching a lot on the net finally got the solution..

Thanks to your Blog..

You Rock Man..! Cheers..!

Worked like a champ.

May Allah give u peace…

nice..it helps me alot…

HADAKALLAH

Super Duper Work Superman…!

Thanks kiranpatils for such lovely blogs you write…

They are a great source of knowledge as well as inspiration to me and I surely know to many others….

Awesome! Saved me some time here – thanks!

Awesome, tried this 100% working. Thank you heaps.

Thank you very much for this article..I got a clear idea of web service

This is our MAN OF MICROSOFT..

COOL WORK OVER THE WORDPRESS BROTHER. HAPPY TO SEE YOUR “HAPPY TO HELP” ATTITUDE.. AS I ALWAYS SAY HE IS “MAN OF MICROSOFT”…. Keep It Up Bro… He deserve to be MVP..

I want you all people to encourage his blogging and appreciate his affords to share his excellent and oustanding knowledge which he has gained by hard work. ( 😉 i knw the way he worked for excellancy, productivity and knowledge gaining for .Net Framework ) if his answer really help you out (which i strongly believe his solution will 100000000% work). You can keep close your eyes and do what he says 😉 and there you are with your all answers.

Finally I would again say “MAN OF MICROSOFT” and one of my BESTEST buddy ever. [though hardly get to talk and meet]

HOPE TO SEE YOU SOOOOOOOOON ON THE LIST OF “MVPs”….(You very well know how long its been I am waiting to see you on MVPs List so please make it faster brother)

ALL THE VERY BEST TO YOU “MAN OF MICROSOFT”…..

Thanks for this post. It has been driving me nuts to figure how to make “LinksTreeView.FindNode(txtPath.Text);” work with populateondemand set to true.

And many more.. — If I share all of them then this blog post will be too huge!

Here’s the Stats Summary which I would like to share with you:

Quick Facts

  • Total Posts : 131
  • Total Comments : 328
  • Total Categories : 44
  • Total Tags : 74
  • Total Visits 2007 : 438
  • Total Visits 2008 : 23,606
  • Total Visits 2009 : 46,991
  • Total Visits 2010 : 47,088
  • Total Visits 2011(till date) : 31,996
  • Average Visits per Day : 190

Thanks to all who inspired and appreciated my work – Yes I am saying thanks to you – My friends,readers and daily visitors!

Happy Reading! 🙂

My Article – Microsoft Certification QuickStart Guide

Challenge:

First of all, apologize for not writing anything since last 3 months, 6 days. The reason behind not writing is that currently I’m focusing on learning,exploring and implementing new CMS named as Sitecore. So, now my challenge area has been changed from pure .NET/ASP.NET to Sitecore CMS . And as per my practice I’m sharing my lessons learnt with the world. But not here it’s on my another blog which is here — http://sitecorebasics.wordpress.com/. So, if you are also using Sitecore or wanted to know about it, please do visit my blog.
Anyways, Let’s come to main point.
After so many questions [In Person, on blog etc.] and motivation from friends. Before so long back I wrote an article on Microsoft Certification.
This article will guide you how to give Microsoft certification exams and it will answer all your questions about Microsoft certification exam.

Solution:

You can download it from here — Microsoft_Certification_QuickStart_Guide. Also you can have a quick look from below and if you find it interesting then only you can download 🙂
[scribd id=56501296 key=key-ee32lpov9yc9d825wna mode=list]
Eager to listen your views/suggestions/comments/feedback.
Happy Certification!
Worth to read :
http://kiranpatils.wordpress.com/2009/06/27/new-milestone-mcts-web70-528/
http://kiranpatils.wordpress.com/2010/04/26/vs-20082010-certification-path/
http://kiranpatils.wordpress.com/2010/01/01/milestone-mcpd-exam-cleared/
3 months, 6 days

CrickoHolic : Cricket Match Score Updater

Challenge

World cup is on! and If you are a cricket fan then you must be checking score update for each match frequently while working. I also do so [When India is playing!]. But sometime while coding I need to keep my Visual studio instance open and at the same time I also want to check score, for which I used to do ALT + TAB, between my Visual Studio and Firefox.
I was thinking to have some tool, which seats at corner of my desktop and keep me updated on latest score without doing any ALT + TAB. You also think so? Then CrickoHolic is the software for that.

Solution

Basically, CrickoHolic will seat at corner of your desktop and keeps you updated about the latest score. And moreover it will always be on TOP of all windows. So, there is no any chance that any window can overlap it. Sounds interesting? Let’s see more about it.

Main features

  • Always on top of all windows.
  • Seats at right bottom corner of your desktop.
  • Auto updated.
  • Shows Current/Recent and Up Coming matches updates.
  • Minimize button added (Thanks to Devang for the suggestion!)

Screen shots


System requirements

.NET 2.0

How to use?

1. Download CrickoHolic.zip.
2. Extract the zip file, you will find file with name CrickoHolic.exe.
3. To run it, just double-click the .exe.
4. That’s it! Enjoy 🙂

I would like to hear from you

If your feedback is positive tell to your peers else tell to me at : klpatil@hotmail.com. Feel free to post your suggestions/comments/bugs at provided email id or below in the comments section.

Would like to Download? Click here

Eager to have your feedback!
Sourcecode : Coming Soon…

TimeZone Converter : Converts Datetime with just few clicks!

Challenge

We all geeks mostly work with clients/colleagues who are outside india and follows different timezone than us. Or sometime we have some meeting/event which has timezone different than us. And to do the calculation we have to remember all the timezone differences and do the calculation and have you forgot to check whether the time span falls in Daylight saving time? huh.. sounds more complex right? Even me too that’s was thinking to develop a tool which will do this for you 🙂 Sounds interesting? then here you go..

Solution

TimeZoneInfo is a class which does everything for you! [It is in .NET Framework 3.5]
Finally, I am glad to share this tool with you. Below are few details of it:

Introduction

TimeZone Converter, helps you to convert provided DateTime from one timezone to another timezone, and keeping Daylight Saving Time in mind!

Main features

  • Source timezone to destination timezone conversion with few clicks!
  • Added Speech support.
  • Scrollbar support added.

Screen shots

System requirements

.NET 3.5 SP1

How to use?

1. Download application from following link.
2. Double click on executable.
3. Provide inputs and click on Convert time OR Press Enter.
5. That’s it! Enjoy 🙂

I would like to hear from you

If your feedback is positive tell to your peers else tell to me at : klpatil@hotmail.com. Feel free to post your suggestions/comments/bugs at provided email id.

Technical links

TimeZoneInfo : http://msdn.microsoft.com/en-us/library/bb396389.aspx

Would like to Download? Click here

Eager to have your feedback!
[Update : 18/2/2012]Sourcecode : Click here to download sourcecode

Debug Your ASP.NET Application that Hosted on IIS

Challenge:

One of my friend asked me that how we can debug Website which is hosted on IIS? The answer was quite simple and I am using it since so long. But I thought I should document it and that’s why putting the information on this blog. So when you guys need to do this, you can do it!

Solution:

First I thought to write my own article. But suddenly thought some one might have already written on this, and I found following nice article:
http://www.codeproject.com/KB/aspnet/ProcessAttache.aspx#9
Article is so nice — Good Job Blog Author!
Just two things I would like to add to it which is as below:

  1. Shortcut for Attach to process menu is CTRL + ALT + P.
  2. If you are using windows XP then you will not find “w3wp.exe“. You will find “aspnet_wp.exe

If you found this post helpful say thanks to CodeProject article author.
Happy Debugging! 🙂