数据表内部使用?

Roy*_*mir 6 c# datatable dispose

我在使用块中声明了datatable,在块的末尾调用Dispose方法.

 using (DataTable dt = Admin_User_Functions.Admin_KitItems_GetItems())
            {
                 ...
            }
Run Code Online (Sandbox Code Playgroud)

但在反射器中,数据表并不具备Dispose功能

在此输入图像描述

那个怎么样 ?

taf*_*afa 3

System.Data.DataTable扩展System.ComponentModel.MarshalByValueComponent并且,MarshalByValueComponent 实现IDisposable.

Reflector 不会显示基类型的方法,除非它们在派生类型中被重写。