-
I recently had to write a T-SQL function which cleans up all non numeric characters from a varchar variable and returns the int value of the remaining numeric characters. If no numeric characters exist, the function should return zero. I thought it would...
-
Reality about software development. Below image says it all ;-) Cheers to every coder reading this blog post :-) Please scroll to the right if you cannot see the entire image at 1 glance or click here to view / download the image in a seperate window...
-
Few months back, I got below joke emailed to me by my friend who is also a passionate coder. In my personal (and humble) opinion, below joke hits jackpot with the current state of 9 out of 10 IT companies in India, which are headed by people who have...
-
We can use the Single extension method of LINQ to return the only element in a sequence that satisfies a specified condition. However the Single extension method would throw the System.InvalidOperationException when no element in a sequence satisfies...
-
We would have to write the below code to add a new item (with value) to any of these 5 controls (BulletedList, CheckBoxList, DropDownList, ListBox, RadioButtonList) C#: bulletedList.Items.Add(new ListItem("text", "value")); checkBoxList...
-
You must have come across plenty of articles on the internet which talk about using the StringBuilder class when computing large strings for performance gains. Nothing wrong with that. However I have not seen many coders using the Initial Capacity constructor...
-
After reading my earlier post T-SQL Query to Find the Second Highest Column Value in a Table a lot of users asked me to also help them with writing a query to find the second lowest column value in a table. So here it is: If we had a table named Employee...
-
We can use the Last extension method of LINQ to return the last element in a sequence that satisfies a specified condition. However the Last extension method would throw the System.InvalidOperationException when no element in a sequence satisfies a specified...
-
We can use the First extension method of LINQ to return the first element in a sequence that satisfies a specified condition. However the First extension method would throw the System.InvalidOperationException when no element in a sequence satisfies a...
-
Google is the second brain for many coders hungry for information. I as a coder cannot imagine a single day at work without Google. Few days back (22 April to be precise), it was Earth's day and I was wondering how we as coders can do our bit for...
-
I find it really annoying to use the GetOrdinal method of the DataReader class everytime I have to access data in a strongly typed manner using any of the Get[DataType] methods of the DataReader class. Have a look at below code: int employeeID = dr.GetInt32...
-
After upgrading from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM, I got the following error when I tried to build my ASP.NET 3.5 project which was initially coded using Visual Studio 2008 Beta 2: Could not load file or assembly 'System.Data...
-
If you have been using ASP.NET themes feature in your ASP.NET projects, you surely must have come across situations where you wished you could set certain properties of controls via skins. For example, in all my ASP.NET projects, I always want to set...
-
Extension Methods are one of the most powerful features of .NET 3.5 and they can add a lot of flexibility to your code and help in cutting down your code size significantly if used wisely. I have been using a lot of Extension Methods in my code lately...
-
If you need to deploy and test your code in SSL environment on IIS 6.0 and Windows Server 2003, but you do not have a valid SSL certificate on your development / test server issued by a trusted third party Certificate Authority (since it costs money)...