2

I have a DataSet that I would like to cache in the ASP.NET's web cache. The content does not change very often and a cache of a few hours should work.

My problem is that when I create the DataSet, I get a CA2000 warning about dispose needing to be called. However, some articles say that I can cache the DataSet. I don't believe the DataSet directly implements Dispose; however, it is derived from a class that does.

What is the best way to cache a DataSet so I do not receive the CA2000 warning?

4

1 回答 1

1

我没有收到与您相同的警告;但实际上,您不需要DataSet在一般情况下处理 a ,因为它不包含任何非托管资源。

请参阅其他答案。

于 2013-08-01T19:00:55.480 回答