h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Get AppSettings.config File in C#.net

Get AppSettings.config File


Input


<configuration>
  <appSettings>
    <add key="ShowQuery" value="true"/>
  </appSettings>
</configuration>

Output

ConfigurationManager.AppSettings["ShowQuery"];

Prevent Multiple Instance Running

Prevent Multiple Instance Running

In Program.cs file add the below code.
 static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Process[] process = Process.GetProcessesByName(Application.ProductName); //Prevent multiple instance
if (process.Length > 1)
{
MessageBox.Show("{Application Name}  is already running. This instance will now close.", "{Application Name}",
MessageBoxButtons.OK, MessageBoxIcon.Information);
Application.Exit();
}
else
{
Application.Run(new <Initial Form>());
}
}

Visual Studio 2013 New Features

Visual Studio 2013 New Features

  • Roaming Settings
  • CodeMap – Visual Debugging
  • Peek Definition – Alt+F12
  • Code Lens
  • New Blue Theme
  • UI Icons
  • Feedback & Notifications
  • Enhanced Scrollbar
  • Navigate To (Ctrl+,)
  • Auto Brace Complete
  • Move Line Up/ Down (Alt Arrow-Up/ Arrow-Down)
  • Minor Tweaks

Using Overloading method via Interface in C#.Net

Here the Example for Using Overloading method via Interface in C#.Net

Interface Name: IFamily
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FactoryPattern
{
    interface IFamily
    {
        string DisplayName(string str);
    }
}
Interface Name: IFamilyMember
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FactoryPattern
{
    interface IFamilyMembers
    {
        string DisplayFamilyMembers(string str);
        string DisplayName();

    }
}
ClassName: ClsFamily
Interface Name(s):IFamily ,IFamilyMembers
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FactoryPattern
{
    class ClsFamily :IFamily ,IFamilyMembers
    {
        public string DisplayName(string str)
        {
            return str;
        }
        public string DisplayFamilyMembers(string str)
        {
            return str;
        }
        public string DisplayName()
        {
            return "Good";
        }
    }
}
Class Declaration and Call Methods
  ClsFamily obj = new ClsFamily();
   MessageBox.Show(obj.DisplayName("Naraayanan"));
   MessageBox.Show(obj.DisplayFamilyMembers("Naraayanan"));            MessageBox.Show(obj.DisplayName());


Visual Studio 2012 New Features

Visual Studio 2012 New Features


  • Dark Color Theme for code editor and IDE windows
  • Quick Launch – search the Visual Studio commands/menu options you need and locate it quickly
  • Pin Tabs(files) that you use often to the left side of the Tab-well
  • Search option in IDE windows
  • Find and Replace window changes
  • Preview Tab
  • Browser Drop Down
  • Create Multiple Solution Explorer Instances
  • Page Inspector
  • IIS Express replaces the ASP.NET Development server
  • HTML5 & CSS3 support
  • Unmodified Visual Studio 2010 project files
  • Single compact toolbar for common commands
  • Code Editor Enhancements
  • New Explorers: Solution, Test, Team and SQL
  • Expression Blend
  • LightSwitch



Visual Studio 2010 New Features


Visual Studio 2010 New Features
  • Multi-targeting Application Development
  • Faster Intellisense Support
  • Editor Zoom Functionality
  • Faster Assembly loading in “Add Reference”
  • Detach Window outside IDE
  • Reference Highlight
  • Faster Code Generation
  • Box Selection
  • Easy Navigation
  • Better Toolbox Support
  • Breakpoints
  • IntelliTrace
  • Hiding the Selected Part of Code
  • DataTips
  • String.IsNullOrWhiteSpace
  • Named and Optional Parameters
  • Highlighting
  • Intelligence Generated as Per Usage
  • Predictable
  • Inherit
  • ClientID Generation using ClientIDMode
  • Dynamic Language Support
  • URL Routing

Add and Remove a assembly from GAC

To install assembly in Cache use  Gacutil.
Goto "Visual Studio Command Prompt" and type "gacutil -i <assembly_name>", where (assembly_name) is the DLL name of the project.
To uninstall assembly, type gacutil –u <assembly name> in  Visual Studio Command Prompt.

Global Assembly Cache

While using shared assemblies, to avoid Assembly being overwritten by a different version of the same assembly , shared assemblies are placed in a special directory subtree in the file system, known as the global assembly cache (GAC).
Placing shared assemblies can be done by special .Net Utilities Only.

assembly version information stored

In the Manifest.

Assembly in Net

Define Assembly 
An assembly is a fundamental unit of any .NET application. It contains the code that is executed by CLR (common language runtime).
I would like to limit the details to what is required to create and use an assembly.
However, it is important to know a few details about assemblies before we delve into creating and using it.
An assembly contains name, version, types (classes and others) created in it and details about other assemblies it references.
An assembly may be either an executable file - .EXE or a dynamic link library - .DLL


Type of Assembly:

  1. Private Assembly
  2. Shared Assembly

Private Assembly:
By default every assembly is a private assembly.
If we add a reference to a private assembly to any project, a copy of the assembly is given to the project.
So each project maintains a private copy of the assembly.

Shared Assembly:
A shared assembly is an assembly that resides in a centralized location known as the GAC (Global Assembly Cache) and that provides resources to multiple applications.
If an assembly is shared then multiple copies will not be created even when used by multiple applications.