Border issue when migrating to .net 4.5 framework

When you convert existing asp.net project to 4.5 framework , you will notice that all the UI elements have blue border around them

image

Making these changes in web.config will solve the problem

<pages enableSessionState=”true” enableViewState=”true” enableViewStateMac=”true” validateRequest=”true” viewStateEncryptionMode=”Always” controlRenderingCompatibilityVersion=”3.5” clientIDMode=”AutoID”></pages>

and

<compilation defaultLanguage=”c#” debug=”true” batch=”false” targetFramework=”4.5” >

Best way to share bookmarks and favorites across all devices - Pocket

In today’s day and age we no longer keep our files and resources on one computer. I have 3 laptops, 2 smart phone and tablet. I have been looking for a good intuitive service which can share all my bookmarks across all these devices. Finally I found pocket, this app is amazing. These guys were previously known as “Read it later”. They have amazing iphone, ipad app and very cool chrome plug-in.   

                                     

"A ‘no’ uttered from the deepest conviction is better than a ‘yes’ merely uttered to please, or worse, to avoid trouble." - Mahatma Gandhi

– (Good read in the words of his grand son Arun Gandhi)

(Source: blogs.hbr.org)

Change Target Framework of all the projects automatically
Recently I had a need to change all my project&#8217;s target framework to 4.0. Usually you can just right click on the project and change this by going in to properties. I needed to do this for 34 project within a single solution file. After googling I landed on an article by Scott dorman who has written nice macro to do this job automatically. 
Change TargetFramework for all the projects in Visual Studio 2010http://www.codeproject.com/Articles/74805/Visual-Studio-2010-and-Target-Framework-Version
Download Macro project from Herehttps://skydrive.live.com/?cid=93D618D639EC9651&amp;id=93D618D639EC9651%21317

Change Target Framework of all the projects automatically

Recently I had a need to change all my project’s target framework to 4.0. Usually you can just right click on the project and change this by going in to properties. I needed to do this for 34 project within a single solution file. After googling I landed on an article by Scott dorman who has written nice macro to do this job automatically. 

Change TargetFramework for all the projects in Visual Studio 2010
http://www.codeproject.com/Articles/74805/Visual-Studio-2010-and-Target-Framework-Version

Download Macro project from Here
https://skydrive.live.com/?cid=93D618D639EC9651&id=93D618D639EC9651%21317

SSRS and Columns from Dynamic SQL

In SSRS when you bind a stored proc, it does not always auto populate the column headers. You may end up adding all the columns manually. There is a quick work around for this.

In your stored proc, use EXEC(” your sql query”) instead of storing the text in Variable and then executing the variable. SSRS plays nice if all your columns are laid out in your EXEC statment.

For example this approach will not detect col1 and col2 in SSRS

— Stored proc
Declare @sql varchar(max)
SET @sql = ”Select col1,col2 from table’
exec @sql

This will

— Stored proc
EXEC(‘Select col1,col2 from table’) 

Reference:
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/c3c6bc0d-728c-4a6e-abeb-2ea961f38e44

Left hand comparison: Better way to write your IF condition

In my daily routine, I use C# as the main language to code. Those from C or C++ world may know what I am talking about.

Try this in your C# code

bool flag1 = true;
if(flag1 = false)
{
Console.WriteLine(flag1);
}
Technically this should give you error (Tested in VS 2010, Framework 4.0) but it does not. Instead of comparing flag1 to false , code will assign false value to flag1. This will always be true and visual studio compiler will never give you error. Note: This is only true for Boolean values.

This is called right hand comparison. Instead I try to follow Left-hand comparison
(http://en.wikipedia.org/wiki/Coding_conventions#Left-hand_comparisons) in which you always put Value on the left hand side of the variable to compare. i.e.if ( false = flag1) then …

This code will always give you compile time error so there is no scope of accidental assignment error.