Top "Using" questions

"using" is a keyword in some programming languages (C++, C#, VB.

Why should I use the "using" keyword to access my base class method?

I wrote the below code in order to explain my issue. If I comment the line 11 (with the keyword "using"), …

c++ oop inheritance using
Do I have to Close() a SQLConnection before it gets disposed?

Per my other question here about Disposable objects, should we call Close() before the end of a using block? using (…

c# asp.net using sqlconnection sqlcommand
Accessing FTP on Google Compute Engine

I'm running an instance on debian-7-wheezy and I'm sort of new to the Google Compute Engine. I have looked …

ssh ftp sftp using google-compute-engine
Using statement vs. IDisposable.Dispose()

It has been my understanding that the using statement in .NET calls an IDisposable object's Dispose() method once the code …

c# .net vb.net using idisposable
Is it a good approach to call return inside using {} statement?

I just want to know is it safe/ good approach to call return inside a using block. For ex. using(…

c# return using
Will Dispose() be called in a using statement with a null object?

Is it safe to use the using statement on a (potentially) null object? Consider the following example: class Test { IDisposable …

c# idisposable using
MemoryStream in Using Statement - Do I need to call close()

When using a memory stream in a using statement do I need to call close? For instance is ms.Close() …

c# using memorystream using-statement
C# "Using" Syntax

Does the using catch the exception or throw it? i.e. using (StreamReader rdr = File.OpenText("file.txt")) { //do stuff } …

c# exception using using-statement
C#: "Using" Statements with HttpWebRequests/HttpWebResponses

Jon Skeet made a comment (via Twitter) on my SOApiDotNet code (a .NET library for the pre-alpha Stack Overflow API): @…

c# httpwebrequest using httpwebresponse using-statement
Catching Exception inside Using statement

I know that Using statement disposes out the object that is being created. Like if I wanted to do something …

c# using