开发者

Are the database-related objects such as connection object, command object, datareader, dataadapter,... unmanaged resources?

开发者 https://www.devze.com 2022-12-16 10:28 出处:网络
Are the database-related objects such as connection objec开发者_开发技巧t, command object, datareader, dataadapter,... unmanaged resources?The objects you refer to are part of the .NET framework, and

Are the database-related objects such as connection objec开发者_开发技巧t, command object, datareader, dataadapter,... unmanaged resources?


The objects you refer to are part of the .NET framework, and are garbage-collectable. So in that sense they are managed resources.

A better question would be, do these objects implement IDisposable? If they do, you can use the using keyword in C# to clean them up once they go out of scope, or call their dispose() method manually.

An example of using the using keyword with SqlConnection and SqlDataAdapter objects is here:

http://weblogs.asp.net/jasonsalas/archive/2005/02/08/368811.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消