Welcome to my blog.

Post on this blog are my experience which I like to share. This blog is completely about sharing my experience and solving others query. So my humble request would be share you queries to me, who knows... maybe I can come up with a solution...
It is good know :-)

Use my contact details below to get directly in touch with me.
Gmail: nadarmuthukumar1987@gmail.com
Yahoo: nadarmuthukumar@yahoo.co.in

Apart from above people can share their queries on programming related stuff also. As me myself a programmer ;-)

Create Connection Strings easily

The connection string may include attributes such as the name of the driver, server and database, as well as security information such as user name and password.

UDL file can be used to generate connection strings easily.

To create UDL file first create new text file and rename it from "filename.txt" to "filename.udl" that's it.

Now run filename.udl by double clicking it.

Data Link Properties window will open, select Provider Tab and select the provider you need and click next.

Now provide the details as required and click on test connection.

If you get success message, you are done.

Now open udl file as text file, connection string will be there in the last line.

Reference: Muthukumar (http://nadarmuthukumar.blogspot.in/), CodeProject

The ‘VSTS for Database Professionals Sql Server Data-tier Application’ package did not load correctly

Visual Studio 2010 and SQL Server Express have an uneasy alliance, at best.  When you install Visual Studio 2010 it installs SQL Server Express 2008 for you, but only the database engine, not SQL Server Management Studio.  If you mess with SQL Server Express in order to install the management tools, or upgrade to 2008 R2, or install the Advanced Services version, things break and you can no longer reliably use the Visual Studio database projects.

In particular, if you remove SQL Server Express 2008 and install SQL Server Express 2008 R2, you’ll probably run into an issue where if you try to open a schema object in a Visual Studio database project you’ll get an error that says:
"‘VSTS for Database Professionals Sql Server Data-tier Application’ package did not load correctly"

The fix for this problem can be found here.  Here’s the short version:
  1. Locate your Visual Studio 2010 installation media.
  2. In the \WCU\DAC folder, you’ll find three MSIs: DACFramework_enu.msi, DACProjectSystemSetup_enu.msi, and TSqlLanguageService_enu.msi.  
  3. Run and install each of them.
  4. Reopen Visual Studio, it should be back to a working state.
Reference: Muthukumar (http://nadarmuthukumar.blogspot.in)

Meaning of decimal(18,2) Ms Sql Server

The actual syntax of the datatype is decimal(p,s).
So here, p is the precision and s is the scale.

The datatype Decimal(18,2)is used to represent numbers.The length of numbers should be totally 18. The length of numbers after the Decimal point should be 2 only and not more than that.


The numbers to the left of decimal point should not be greater than 16.

The numbers to the right of decimal point should not be greater than 2.
(.) is excluded here in the length.

So,the overall length of the number cannot exceed the length 18.

Reference: Muthukumar (http://nadarmuthukumar.blogspot.in)

Convert dd mm yyyy string to datetime

Create a function as shown below.
Your can use any one of the method give below inside the function, rest you can comment it out.
private DateTime FormatDate(string _Date)
        DateTime Dt;
        //Method 1
        System.Globalization.DateTimeFormatInfo dateInfo = new System.Globalization.DateTimeFormatInfo();
        dateInfo.ShortDatePattern = "dd/MM/yyyy";
        Dt = Convert.ToDateTime(_Date, dateInfo);
        //Method 2
        IFormatProvider mFomatter = new System.Globalization.CultureInfo("en-US");
        Dt = DateTime.ParseExact(_Date, "dd/MM/yyyy", mFomatter);
        //Method 3
        Dt = DateTime.ParseExact(_Date, "dd/MM/yyyy", null);
        return Dt;
To call the function use below code
string UrDate = "27/08/2008";
DateTime _obj = FormatDate(UrDate);

Reference: Muthukumar (http://nadarmuthukumar.blogspot.in)

What is an application domain (appdomain)

What is an application domain (appdomain)

Before .NET framework 2.0 technology, the only way used to isolate applications running on the same machine is by the means of process boundaries. Each application run within a process, and each process has its own boundaries and memory addresses relative to it and this is how isolation from other processes was performed.

.NET framework 2.0 introduces a new boundary called the Application Domains.

Application domain is nothing but a boundary within which an application runs.
process can contain multiple application domains. Application domains provide an isolated environment to applications.

An application running inside one application domain cannot directly access the code running inside another application domain. To access the code running in another application domain, an application needs to use a proxy.

Application domain is used to isolate executed software applications from one another so that they do not affect each other. This is achieved by making any unique virtual address space run exactly one application and scopes the resources for the process or application domain using that address space.
The .NET runtime enforces AppDomain isolation by keeping control over the use of memory - all memory in the AppDomain is managed by the .NET runtime, so the runtime can ensure that AppDomains do not access each other's memory.

Application Domain is used to create a mirror image of an application. reason being if you do not want to stop OR
down the site , .Net framefork give u feature called App Domain, through which u can make the changes and uploaded
to the site without getting it down or Stop.

The main advantage is the ability to run several applications domains in a single process or application. All of this is performed while maintaning the same level and quality of isolation that would exist in separate processes, without the need of making cross-process calls or switching between processes.

isolation, code running in one application domain can not access code or resources running in another application domain.
security, You can control the permissions granted to a given piece of code by controlling the application domain inside which the code is running.
robustness, error in code running in one application domain can not affect other applications although they all are running inside the same process. Individual application domain can be stopped without stopping the entire process, you can simply unload the code running in a single application domain.
They are less expensive than full processes
They are multithreaded
You can stop one without killing everything in the process
Each app domain runs on its own security level

Reference: Muthukumar (http://nadarmuthukumar.blogspot.in/)
netsqlinterviewquestions, dotnetfunda, crazyengico, allinterview

Get last inserted ID in sql server

  1. It returns the last IDENTITY value produced in a table, 
  2. IDENT_CURRENT is limited to a specified table.
  3. IDENT_CURRENT returns the identity value generated for a specific table.
Reference: Muthukumar (http://nadarmuthukumar.blogspot.in/), SqlAuthority

Twitter Delicious Facebook Digg Stumbleupon Favorites More