MiniProfiler - ProfiledDbDataAdapter

点点圈 提交于 2019-12-01 13:23:33

It turns out that though ProfiledDbDataAdapter inherited from DbDataAdapter, it did not override the default functionality of DbDataAdapter.Fill(DataTable), leading to the errors that you saw.

I fixed this in the MiniProfiler code. Fix is available in nuget, version 3.0.10-beta7 and higher.

I have tested this with your code from above and it works for me:

DbConnection connection = 
             new ProfiledDbConnection(sqlConnection, MiniProfiler.Current);    
var sql = "select * from countries";
DbDataAdapter dataAdapter = new SqlDataAdapter(sql, sqlConnection);
ProfiledDbDataAdapter prdataAdapter = new ProfiledDbDataAdapter(dataAdapter);    
var table = new DataTable();
dataAdapter.Fill(table);            // this now works
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!