Top "Using-statement" questions

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

Where do I put try/catch with "using" statement?

Possible Duplicate: try/catch + using, right syntax I would like to try/catch the following: //write to file using (StreamWriter …

c# try-catch using-statement
The C# using statement, SQL, and SqlConnection

Is this possible using a using statement C# SQL? private static void CreateCommand(string queryString, string connectionString) { using (SqlConnection connection = …

c# sql using-statement
How to use an iterator?

I'm trying to calculate the distance between two points. The two points I stored in a vector in C++: (0,0) and (1,1). …

c++ pointers vector iterator using-statement
SqlCommand (Using Statement / Disposing issue)

Take the following example... Using cn As New SqlConnection(ConnectionString) Try Dim cmd As SqlCommand = New SqlCommand With cmd .Connection = …

vb.net dispose sqlcommand using-statement
SqlCommand with using statement

I saw that in most samples SqlCommand was used like this using (SqlConnection con = new SqlConnection(CNN_STRING)) { using (SqlCommand …

c# sqlconnection sqlcommand using-statement
Will a using statement rollback a database transaction if an error occurs?

I've got an IDbTransaction in a using statement but I'm unsure if it will be rolled back if an exception …

c# transactions rollback using-statement
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
Exception of type 'System.OutOfMemoryException' was thrown. C# when using IDataReader

I have an application in which I have to get a large amount of data from DB. Since it failed …

c# sql exception datareader 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