Opening SqlConnection that has been closed already
问题 Are there any problems with closing and opening of the same SqlConnection object instead of creating new one each time? For example: SqlConnection conn = new SqlConnection(ConnectionString); conn.Open(); //Some work here conn.Close() //Some work here... conn stays in scope conn.Open() Is there any chance to get illegal state exception by opening connection second time? 回答1: You can reopen the connection after closing it (you cannot reopen a disposed connection, though). As for Dave Zych's