473,320 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

CollectionBase Class and DataSet

Siu
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.
Nov 16 '05 #1
4 2841
Hi,

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

what you want to do?
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Siu" <Si*@discussions.microsoft.com> wrote in message
news:76**********************************@microsof t.com...
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.

Nov 16 '05 #2
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.
"Siu" <Si*@discussions.microsoft.com> wrote in message
news:76**********************************@microsof t.com...
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.

Nov 16 '05 #3
Siu
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?

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

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

what you want to do?
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Siu" <Si*@discussions.microsoft.com> wrote in message
news:76**********************************@microsof t.com...
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.


Nov 16 '05 #4
Siu
.... I'm sorry but I've forgotten to precise that I want to transform it into
a typed dataset.

Can you still help me?

"James Curran" wrote:
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.
"Siu" <Si*@discussions.microsoft.com> wrote in message
news:76**********************************@microsof t.com...
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.


Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steve M | last post by:
I have subclassed CollectionBase. I have also implemented GetEnumerator(). I have tried to set the DataSource of a DataGrid to an instance of my subclass. However, the items in the grid are not...
7
by: m. pollack | last post by:
Hi all, I've been using the CollectionBase class to implement a strongly-typed collection, but I have noticed that the RemoveAt method does not seem to call the "On" hook methods (OnRemove,...
5
by: Eric Johannsen | last post by:
I have a simple object that inherits from CollectionBase and overrides the Count property: namespace MyTest { public class CollTest : System.Collections.CollectionBase { public override int...
0
by: Steve Mauldin | last post by:
I have data in a collection class of credit cards and I need to query it to get only the records associated with a particular Personid. I was thinking that there should be a dataadapter to use a...
1
by: Kyle Novak | last post by:
I have a question about strongly typed objects when looping through a collection based on the CollectionBase object and using a For..Each loop. I have 2 objects: -Invoice: Holds all properties...
2
by: Samuel R. Neff | last post by:
What's the advantage of inheriting from CollectionBase as opposed to just implementing IList? It seems that it saves you from having to implement a few properties (Clear, CopyTo, Count,...
4
by: _DS | last post by:
I need to create arrays of a custom data type (which is composed of various strings, ints, the usual). The original was built using CollectionBase. I was thinking about redesigning to use...
0
by: LIJO CHEERAN | last post by:
Hello friends I am trying to study about CollectionBase. I have inherited CollectionBase in the class TheCollection.cs. I am using the “TheCollection. in an aspx page to store objects...
1
by: jc | last post by:
RE: Why use a CollectionBase class here vs dataset or dataview? I'm looking at some vb.net 2005 code that was generated from a homegrown Codesmith Template that generate all of the retreival and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.