Assume the following code:
using (SqlConnection conn = new SqlConnection(connectionString))
{
...
using (SqlCommand comm = new SqlCommand(...))
{
.. do stuff ..
if(condition) Response.Redirect("somepage.aspx");
}
}
Will Response.Redirect () exit from usage blocks cause it to delete all connections?
Or, alternatively, is there a way to exit the usage block that will not result in deletion?
EDIT: I do not want to exit without deleting. I want to know about any pitfalls that might make it not work. - Of course, the prohibition of failures, but then I’m sure that all the facilities are located - the hard way - in this situation
I accepted the answer, which essentially says “I don’t know”, but he very well researched “I don’t know”
Over the course of average time, I will assume that Response.Redirect interrupts the usage statement and code with this in mind. “Not yet proven.”