Getting the absolute path in ASP.NET which is application independent

There comes a time when you need to get the absolute path to reference a file or some resource existing at some relative path of the website or web application. As things turned i was in need some of the similar functionality. The first thing that came to my mind was doing something similar :
 

//get [...]

How-To : Splitting delimited strings using XQuery in SQL

Well, this was just kind of an experiment of sorts of using XQuery. The idea just occured some time back when i was trying some other similar experiment.
Now as you all know there is no in-built function for Split in SQL. So lots of people have come out with different solution. This solution is [...]

Trimming extra space in SQL

Sometime back i had come across this small problem. Mind you this is not a problem you come across many times, but it is interesting little problem nonetheless. The problem was removing extra spaces in a given string.
For e.g if you have some string like so “This is a                   line which    contains multiple        spcaes.” and [...]

Dataset to XML and loss of information

When weneed to persist a dataset object, usually what we do is use the WriteXml() method for the Dataset object. For most cases the default implementation works fine.
So

DataSet dsObj = GetDatasetObject();
dsObj.WriteXml(filename);

If while saving the dataset, a particular contained NULL values, that column information will not be outputted. So when you try to [...]

Retrieving comma seperated values from SQL Server

Many a times, we are pressed with a problem of retrieving comma seperated values from SQL server. There are quite a few ways to do it, for instance using cursors, using user defined functions or using COALESCE (the most preferred). Come SQL Server 2005 and there is one more technique which can be employed (his [...]

Using custom serialization to store object information in ViewState

Recently i came across a wierd problem while developing a web user control. I needed to persist some data across page postback’s. I took the ViewState approach, which had been used previously to do the same task.
I had thought that it would be easy as it had been done a multiple times earlier, but [...]

HOW-TO: Search string value contained in comma seperated string

Quite often when we need to pass multiple values to the stored procedure, we pass the value as comma seperated string. The problem is how do we search for a column having a value contained in the comma seperated string.
For e.g. suppose you have a Books table which has "Type" property. The "Type" property can [...]

Enum with Flags Attribute and Extension method

For quite some time now i have been intending to write about Enum with Flags attribute set. Enum with Flags attribute set allows the enum to be used as Bit flags where each bit signifies whether a particular option is set or not. When using this very powerful feature there is always a need to [...]

Secrets of the "Using" statement

Anyone who has used C# must be familiar with the most useful and the most underrated statement in th C# vocabulary, the "USING" statement. It is so common that you almost forget that it exists in there and its most common usage is to simplify the usage of objects in namespace i.e. Seperation of object [...]

Using NULL Coalescing Operator

As i was reading the great book “CLR via C#” by Jeffery Richter, i stumbled upon one of these very subtle nuances and useful technique introduced in C#, it is called the NULL Coalescing Operator denoted by “??” (refer C# Reference (MSDN))
As per the definition the “Null Coalescing ” returns the value denoted by the [...]