Dispose your DataContext After use
This is my first blog post on here, so Hello from me.
Rather than just have a meaningless 'hello' first post, i thought i would at least post something useful (albeit rather small)..
With all the talk of LINQ at the moment there are a lot of examples popping up on sites and most of them follow this kind of format...
myDbDataContext ctx = new myDbDataContext("connectionString");
var query = from.... //great LINQ example etc...
//oh, wait, no disposal of my data context?
When i first started learning LINQ I was pretty curious as to why most examples do not offer some kind of indication that disposal is required. Maybe because that is exactly what they are - examples. Regardless, i have always disposed my dataContext objects, usually taken care of automatically by wrapping them in a using block.
It is advised on various sites, as pointed out in this MSDN forum post
I am currently preparing a rather long post on SEO management for Asp.Net and hope to have that up soon.