7
в блоці "використання" закривається повернення SqlConnection при поверненні чи виняток?
Перше питання: Скажіть, що у мене є using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); string storedProc = "GetData"; SqlCommand command = new SqlCommand(storedProc, connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@EmployeeID", employeeID)); return (byte[])command.ExecuteScalar(); } Чи закривається з'єднання? Тому що технічно ми ніколи не досягаємо останнього, }як returnраніше. Друге питання: На …
136
c#
using
sqlconnection