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 February 15, 2008 by kalpeshshirodker
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 [...]
Filed under: How To, SQL Server, Technical | Leave a Comment »
Posted on January 31, 2008 by kalpeshshirodker
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, [...]
Filed under: C#, How To, Technical | Leave a Comment »