0

I create ADODB recordset, command etc in my winform app and was wondering if I should implement IDisposable on their wrapper classes to free them. Are they unmanaged resources?

And to release any unmanaged resource, should call the Marshal.ReleaseObject(resourceInstance) or just setting it to null is enough?

Thanks in advance Nishitha

nishitha nair
  • 163
  • 4
  • 14
  • 1
    Curious: why not ADO.NET? – Yuriy Galanter Mar 02 '16 at 14:20
  • 1
    ADODB is a COM technology and only has name similarity with ADO.Net. Why wouldn't you use ADO.Net? – Cetin Basoz Mar 02 '16 at 14:22
  • No specific reason. It was a migration from Vb6. And we were doing it dll by dll manually. So in early stages, we were implementing some interfaces from a VB6 dll that expected a adodb recset or command to return. Now I can in fact use ADO.Net but may be in future a refactor and not immediately. So with Cetin Basoz's reply I conclide that I need to implement IDisposable for the wrapper class. And please do tell me if I should call the Marshal.ReleaseObject to free memory? – nishitha nair Mar 03 '16 at 04:06

0 Answers0