Search code examples
c#-4.0value-typereference-type

Dataset/datatable is a value type or reference type


Is datatable/dataset is value type of reference type?

But the most important question in my mind is- "how to find whether a type is a value type or reference type?"


Solution

  • They are both reference types.

    You can look up the information on MSDN - if they are classes, they are reference types, if structs, value types.

    See DataTable and DataSet. As you can see, they are both declared as classes.