Top "Using-statement" questions

A `using` statement is a C# and VB.

The type or namespace name could not be found

I have a C# solution with several projects in Visual Studio 2010. One is a test project (I'll call it "PrjTest"), …

c# visual-studio-2010 reference using-statement using-directives
What is the C# Using block and why should I use it?

What is the purpose of the Using block in C#? How is it different from a local variable?

c# .net syntax using using-statement
What are the uses of "using" in C#?

User kokos answered the wonderful Hidden Features of C# question by mentioning the using keyword. Can you elaborate on that? …

c# using using-statement
using statement with multiple variables

Is it possible to make this code a little more compact by somehow declaring the 2 variable inside the same using …

c# using-statement
try/catch + using, right syntax

Which one: using (var myObject = new MyClass()) { try { // something here... } catch(Exception ex) { // Handle exception } } OR try { using (var myObject = …

c# try-catch using-statement
Does Java have a using statement?

Does Java have a using statement that can be used when opening a session in hibernate? In C# it is …

java hibernate using-statement
Why can't I reference System.Runtime.Serialization.Json in C#

I want to use an API to get info from the interwebz. The API returns data in Json format. I'm …

c# json api using-statement
C# using statement catch error

I am just looking at the using statement, I have always known what it does but until now not tried …

c# using using-statement
Why use a using statement with a SqlTransaction?

I've been running into some problems concerning a SqlTransaction I'm using in my code. During my Googling I see many …

c# using-statement
returning in the middle of a using block

Something like: using (IDisposable disposable = GetSomeDisposable()) { //..... //...... return Stg(); } I believe it is not a proper place for a return statement, …

c# dispose idisposable using-statement