我收到错误“连接属性尚未初始化”,代码如下:
DbConnection connection = new SqlConnection(connStr);
connection.Open();
connection = new StackExchange.Profiling.Data.ProfiledDbConnection(connection, MiniProfiler.Current);
SqlCommand command = new SqlCommand("GetLanguages", connection as SqlConnection);
command.CommandType = CommandType.StoredProcedure;
command.CommandTimeout = 240;
command.ExecuteReader();
当它到达 command.ExecuteReader(); 线。
如果删除线
connection = new StackExchange.Profiling.Data.ProfiledDbConnection(connection, MiniProfiler.Current);
然后代码工作正常。导致我的执行阅读器抛出错误的已分析数据库连接是什么?