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 [...]

Reading SQL Trace Files using fn_trace_gettable function

While working in SQL Server, most of the time we create trace files(.trc) to identify performance bottleneck. You can create trace files using SQL Profiler or you can use SQL as well. Most of us would go SQL Profiler way, because simply putting is very easy and quite elegant too, further more it gives you [...]

Events and Reflection: Assigning Callback methods to events using Reflection.

Sometime back while coding for a project, i was faced with a unique problem. While let me explain what i was trying to do.
As all of you know, .NET provides us to define our own events which are executed on some condition. You can provide a function which will be executed when the event occurs, [...]