Posted on October 5, 2009 by kalpeshshirodker
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 [...]
Filed under: C#, Dot Net, How To, Technical | Leave a Comment »
Posted on September 25, 2009 by kalpeshshirodker
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 [...]
Filed under: How To, SQL Server, Technical, XQuery | Leave a Comment »
Posted on September 24, 2009 by kalpeshshirodker
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 [...]
Filed under: How To, SQL Server, Technical, XQuery | Leave a Comment »
Posted on September 23, 2009 by kalpeshshirodker
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 [...]
Filed under: C#, Dot Net, How To, SQL Server, Technical | Leave a Comment »
Posted on September 19, 2009 by kalpeshshirodker
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 [...]
Filed under: How To, SQL Server, Technical, XQuery | Leave a Comment »
Posted on September 19, 2009 by kalpeshshirodker
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 [...]
Filed under: C#, Dot Net, How To, Technical, Uncategorized | Leave a Comment »
Posted on September 14, 2009 by kalpeshshirodker
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 [...]
Filed under: How To, SQL Server, Technical | Leave a Comment »
Posted on September 12, 2009 by kalpeshshirodker
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 [...]
Filed under: C#, Dot Net, How To, Technical | Leave a Comment »
Posted on March 28, 2009 by kalpeshshirodker
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 [...]
Filed under: C#, Technical | 4 Comments »
Posted on February 23, 2009 by kalpeshshirodker
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 [...]
Filed under: C#, Technical | 1 Comment »