Error when trying to access Source Control with Team Explorer- No such Interface found

Try the following steps to resolve the issue:

1. Open a command prompt.

2. Navigate to the following folder:

  “%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\”

3. Type the following:

devenv.exe /resetuserdata


Bugs and Defects

What is the difference between the bug and defects? bug and defect are differ only theoretically, practically all are same.
Error : Any deviations from the requirements is an error
Bug : Bug is an error during the execution of program
Defect : Post production errors are called as defects
Fault : It is the condition where the system/component is unable to function as per the
Failure : It’s the inability of the system to function as per the requirements.

Pivot Table

Yesterday I was wondering about how to use Pivot tables in SQL Server with SQL, Thougtht  of share the concept with simple example.

What is Pivoting?
 Pivoting is reorganizing the table data. This can help to quickly summarize the flat data,and displaying information in a more useful way to interpret.

Following is the example

 After Pivoting

Lambda Expression- Compare list with custom collection

Following example illustrates how to compare the string list with custom collection using Lambda expression

class Program
public class First
      public string Name

static void Main(string[] args)
List nameList = new List {“Hai”, “Welcome”};
First first = new First
Name = “Hai”
List firstList = new List

bool result = (firstList.Any(field => nameList.Contains(field.Name)));
Console.WriteLine(“Name Found in name list…”);

How change the height of the iframe at run time- using script

Following javascript is useful when we wants to change the height of the iframe at run time
<asp:Content ID=”ModuleContent” ContentPlaceHolderID=”ModuleContent” Runat=”Server”> 
 <iframe id=”testFrame” src =”c:\Test.html” scrolling=”no” width=”80%” height =”0″ frameborder=”0″ onload=”resizeFrame(this);”>
 <script type=”text/javascript” language=”javascript”>
  function resizeFrame(iframe) {
    iframe.height = document.frames[].document.body.scrollHeight + 20;    

Garbage Collection

Recently I had a chance to revisit the .Net framework concept ‘Garbage Collection’. It was quite interesting.
Garbage collection basically to reclaim the memory of th eobject which no longer being used.CLR(common language runtime) using the garbage collection algorithm to identify if the application is using an object or not?

How the algorithm works?
All the application has the roots( ie: static, global variable, CPU registers) the roots refer to an objects on the managed heap . The list of active roots is maintained by the just-in-time (JIT) compiler and common language runtime. Initially garbage collection assume that all the objects in the heap are garbage. Finally it assume and reclaim the memory of the obejct which doesnot have the pointer with the root.

Object In Heap

Object In Heap


Heap after garbage collection

Create and Use a Template in C#

How to create and Use a Template in C#

Template is use to create a  Skeleton for New Item(File) or project     
   1. Itemtemplate (For File)
   2. ProjectTemplate (For Project)

How to Create  ItemTemplate

1. It require Template class file (.cs)
2. vstemplate (VisualStudio Template), It is a XML file having the extension as .vstemplate

All vstemplate files must have the following format:

<VSTemplate Version=”1.1.0″>

<VSTemplate Version=”2.0.0″ xmlns=”″&gt;            <TemplateData>
                        <Name>Sample Template</Name>
                        <Description> This is the Sample Template for Testing /Description>
                        <Icon>Sample.ico</Icon>—————If u want any Icon for Template
                        <DefaultName>Default Sample Name</DefaultName>–Default name for the File
    <ProjectItem SubType=”Code” TargetFileName=”$fileinputname$.cs” placeParameters=”true”>SIMPLE.cs</ProjectItem>

Save the above file as “SIMPLE.vstemplate”

SIMPLE.cs is  class file to act as Template using the skeleton of  .vstemplate

using System;
using System.Collections;
namespace $rootnamespace$ —————————–Detect the Namespace name
    public class $safeitemname$—————————-Detect the class
                public $safeitemname$()

1 .Save the both file (SIMPLE.cs and SIMPLE.vstemplate) in to the same directory, for example SIMPLE
2. Make the above directory as a zip file. Now, we could put it in to the ItemTemplates directory \My Documents\Visual Studio 2005\Templates\ItemTemplates Drop the zip file in that folder and then load Visual Studio. Create a new project and right-click to add a new file. There you’ll see our new template, select the Template and enjoy coding.