c# - Why does my SqlConnection remain in the SSMS Processes list after closing it? -


i have c# console application following code:

using (var cn = new sqlconnection()) {     cn.connectionstring = "data source=localhost;integrated security=true;persist security info=false";     cn.open();      system.console.writeline("past open"); }  system.console.readline(); 

when running, set 2 breakpoints. 1 @ writeline , 1 @ readline. have sql server management studio (ssms) opened , watching activity monitor's processes list.

when run application , hit first breakpoint (at writeline), see process, in ssms processes list, application name ".net sqlclient data provider" , database "master".

when f5 second breakpoint, expectation process removed processes list since i've closed sqlconnection point. however, process remains in list until application closes.

my assumption process remains in list since connection not closing. if assumption accurate, else need close connection? if assumption inaccurate, why process still listed , how can test if connection closed properly?

thanks.

as know - when you're using close or dispose method - you're returning connection connection pool reused (connection won't closed) - can more info here.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -