CollectionBase Class and DataSet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I've written a class which inheritates from the CollectionBase class

public class MyClass : CollectionBase
{
}

An object istantiated from MyClass can be transformed in a DataSet? does
exist a method which transform it into a DataSet?

MyClass myObject = new MyClass();

Thank you.
 
Hi,

I don;t understand what you want to do, what is the link between
collectionbase and dataset?

what you want to do?


cheers,
 
Well, first of all, a Collection is closer to a DataTable than a
DataSet(*). Now, assuming that you want to make each property of the
contained object a column and each object a row, it wouldn't be that
difficult using Reflection, but I don't know of any existing method to do
it.


(*) A DataSet is a Collection of DataTables, although most of the time, it's
underused, and there's only one DataTable in a DataSet.
 
Thank you for answering to me.
I would like to transform my collecitonbase into a typed dataset, beacause
it's easier to use with windows and web controls, especially with reporting
services.

Do you have any suggestion?
 
.... I'm sorry but I've forgotten to precise that I want to transform it into
a typed dataset.

Can you still help me?
 
Back
Top