Possible Duplicate:
What is the C# Using block and why should I use it?
If I ran the following code:
using (SPWeb web = SPContext.Current.Site.OpenWeb("/myweb")){
//error happens here
}
Would the object web be disposed of properly if an error occurred before the closing bracket?
We were told that using using statements for our OpenWeb object was the best but
we are seeing a lot of errors in the logs about SPRequests and SPWeb.