Tech Off Thread

4 posts

DataColumn

Back to Forum: Tech Off
  • User profile image
    Harlequin

    In .NET DataColumn objects are IDisposable, but if you have a DataColumn[], then you can't dispose of it. How come, just wondering?

  • User profile image
    Maurits

    Because arrays are not disposable.  Arrays of T do not descend from T.

    Walk the array and dispose of each item individually.

  • User profile image
    Pop Catalin Sever

    DataCollumn[] is an array type that stores references to DataCollumn objects in heap because DataCollumn is a reference type.

    The Array Type is a reference type that doesn't implement IDisposable

    DataCollumn[] is an type derived from Array, compiler generated

    and ofcourse it does'i implement the same interfaces of it elements.

  • User profile image
    Harlequin

    Gotcha...thanks a bunch Cool

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.