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
[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