DataColumn.DataType = GetType(System.Object)?

G

Guest

Hi all,

[VS2003, Framework 1.1]

I have a grid binded to a DataTable that needs to hold an object reference
for each DataRow in a column. I could simply add a custom column in the grid
or try to insert the references directly inside the DataRows. The
DataColumn.DataType method do not hold System.Objects. Understandable, since
a DataTable should hold info that would ultimately be inserted into a
Database and that System.Objects do not map to database fields. Still, it
would be more convenient for me to pass around in my application references
to one single DataTable instead of one DataTable and one array of
System.Objects...
I guess that there should be a way to get the memory handle to the
System.Object (maybe as an integer), put it as an Int32 inside the DataColumn
and retrieve the object from memory later... but I would probably have to
ensure that my application keeps at least one pointer to these objects so
that they would remain in memory, assuming that the memory adress do not
change at runtime... Yuck. I also though of subclassing DataColums and
DataRows but that could get messy real fast. Anyway, if any of this is
possible, how can I achieve it? If not, is there a better way to do this?

Thanks
 
S

Scott M.

DataColumns do not hold DataRows as you indicate below. Instead, a DataRow
is made up of columns.

Could you be a little more clear as to what exactly you need and/or are
trying to do? It seems that your post kind of picks up on a train of
thought that you haven't let the rest of us in on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top