Here on above example I just try to connect to a database and take out all records from MyTable.

I have created a SqlConnection object named myConnect and a SqlDataReader object named dr, at the very bottom of the code snippet I have disposed those two objects using Dispose() method.

What will happen if I forget to dispose these objects? memory issues, using statement is a remedy for this and its makes code more readable, robust and clean. I will recode the above code snippet with using “using ” statement.

Don’t you feel more comfortable with using statement? Let me just go bit deep on using statement, how does this work? Actually when an using statement compiled, the CLR converts it to a try and Finally block. It does three things, get the resources (SqlConnection ), encloses in a try block and disposes in the Finally block. Hope you enjoyed …………….

Instead of having all connection string detail on web.config file , we can create a new configuration whatEvernName.config eg(connectionString.config) and have all connection string details in this new .config file.

This is really nice feature when you have a lot of tags in your web.config file, as it increases the readability. There is another cool feature which is very useful for developers when it’s come to development or rather I would say debug the code. Most of the times we have our connection string in one file and there is a high chance to forget to change live connection string properties to test environment properties, I have made such a mistake and had to restore a latest database backup, but luckily there was not any data lost.

This cool feature avoids taking place such a bad mistake. Try this it’s is really nice and you do not have to keep on changing your web.config’s conection string values. As in above code snippet you can have two config files as connectionString.debug.config and connectionString.releaase.config

VS IDE will take the valuse depending on what you have selected, debug or release. Isn’t it cool. Enjoy…

We had a grid view and one of the column data was dynamically bound. Most of the time this grid goes out of the sreen area and makes user to scroll to right, because of this dynamically bounded column's text lenght. There were some solutions on the web but none of them working properly. Solution is, put the text inside a paragraph tag “<p> your text here</p>”