Newbie: Can I save objects in a DataTable?

  • Thread starter Thread starter deko
  • Start date Start date
D

deko

Can I save Array objects in a DataTable? If I can, I assume the Framework
has methods to serialize this out to XML. What I am trying to do is create
an in-memory database when a form opens, and persist it out to XML when the
form closes. The joker in the pack is that I need to save objects in the
table and not just primitive data types. Is this possible?
 
Can I save Array objects in a DataTable? If I can, I assume the Framework
has methods to serialize this out to XML. What I am trying to do is
create an in-memory database when a form opens, and persist it out to XML
when the form closes. The joker in the pack is that I need to save
objects in the table and not just primitive data types. Is this possible?

http://msdn.microsoft.com/library/d...lrfsystemdatadatacolumnclassdatatypetopic.asp

The answer is no.

Then ADO.NET DataColumn.DataType property supports only the base .NET
Framework data types.

whaddya think this? Oracle?
 
SS2K5 can store XML in a column but I don't know of many that would
recommend this approach. You can also construct a User-defined type of your
own but again, this should be used with caution.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Deko,

At least you can normaly serialize by instance an arraylist.
That you can save in a datatable. It is quiet easy. See this sample.

Be aware that in this way is not an easy way of working with a database
(only your program can use it, not somebody who is not using your program,
beside those who know the method of course and can do that.)

http://www.windowsformsdatagridhelp.com/default.aspx?ID=7ffd296f-9e81-47e6-88dc-61641f5c8d9d

I hope this helps,

Cor
 
Back
Top