Am I closing this SQL connection in a C# function appropriately?
问题 In an attempt to close my question on connections remaining open and exceeding the maximum pool, I'm trying tor rewrite the function that is used to connect to our database. The function exists within a homegrown compiled library. using reflector I can see the code looks like this: public SqlProvider([Optional, DefaultParameterValue("")] string StrConnection) { string str; if (StrConnection == "") { str = ConfigurationSettings.AppSettings["ConStr"]; } else { str = StrConnection; }