報錯信息:There is already an open DataReader associated with this Connection which must be closed first 緩解的方案:在實例化database的時候利用線程獨立實例化,每個線程一個單獨的database實例 ...
報錯信息:There is already an open DataReader associated with this Connection which must be closed first
緩解的方案:在實例化database的時候利用線程獨立實例化,每個線程一個單獨的database實例
[ThreadStatic] private static Database _threadInstance = null; protected Database DB = CreateDatabase(); public static Database CreateDatabase() { if (_threadInstance == null) { _threadInstance = new Database(connectionStr); } return _threadInstance; }
隨筆記錄。