Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Error serializing value 'Table1' of type 'System.Data.DataTable.'

Reply
Thread Tools

Re: Error serializing value 'Table1' of type 'System.Data.DataTable.'

 
 
bruce barker
Guest
Posts: n/a
 
      01-02-2007
if you store an unserializable object in a table, then it is no longer
serilizable. you will need to write a serializer/deserialzer for each of
your controls.


-- bruce (sqlwork.com)



Adam wrote:
> I need to store a collection of dynamically loaded controls in my User
> Control. Each control is linked to a headerid and a headerid can have many
> controls. My first dead end was to use a List<int, Control>, but that would
> not serialize at all. I since changed to using a DataTable. My DataTable is
> not serializing (the error message is the title of this post). Please help.
> Here is some code:
>
> private DataTable LoadedControlsDT
> {
> get
> {
> if (ViewState[LocalViewStateKeys.LoadedCtrls] == null)
> {
> DataTable dt = new DataTable();
> DataColumn dc = new DataColumn("headerid", typeof(int));
> dt.Columns.Add(dc);
>
> dc = new DataColumn("control", typeof(Control));
> dt.Columns.Add(dc);
>
> ViewState[LocalViewStateKeys.LoadedCtrls] = dt;
> }
> return (DataTable)ViewState[LocalViewStateKeys.LoadedCtrls];
> }
> set
> {
> ViewState[LocalViewStateKeys.LoadedCtrls] = value;
> }
> }

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Serializing PriorityQueue<type> not working? Twisted Java 3 10-14-2012 04:46 PM
"raise (type, value, traceback)" and "raise type, value, traceback" Jack Bates Python 0 05-02-2011 05:23 PM
Serializing a glib data type akappa C Programming 10 08-20-2007 04:23 AM
serializing and deserializing enum type yu_kuo@sina.com C++ 10 08-18-2007 02:41 AM
compiler error: argument of type "VALUE *" is incompatible with parameter of type "VALUE" me2faster@excite.com Ruby 1 05-05-2005 11:23 PM



Advertisments