I think i figured out what the problem was...
at a glance, the two codes are looking the same but they're not... as you might have been aware in c# that the using keyword will call the disposal method (to execute the garbage collector) at the end of the statement which will return back the memory allocation (reference type) back to heap.
In this case, the using keyword will call sh.close() once it reaches the closing block.
let me know if you have any further comments.