Home All Groups Group Topic Archive Search About

Serialization Error

Author
12 Feb 2007 3:40 PM
mianiro
Has anyone had a serialization error occur when adding a variable to a
viewstate?  The error states 'Error serializing value
'System.Data.SqlClient.SqlDataReader' .  It does not mention
explicitly that it is from the viewstate, however, when I remove the
code for adding the data reader to the viewstate, I don't get the
error. I'm not having any luck trying to troubleshoot this online.

Author
12 Feb 2007 8:31 PM
Kevin Spencer
A DataReader is not serializable as XML. If you want to store a result set
in ViewState, use a DataTable or DataSet.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

The shortest distance between 2 points is a curve.

Show quote
"mianiro" <mian***@gmail.com> wrote in message
news:1171294851.369206.141640@a34g2000cwb.googlegroups.com...
> Has anyone had a serialization error occur when adding a variable to a
> viewstate?  The error states 'Error serializing value
> 'System.Data.SqlClient.SqlDataReader' .  It does not mention
> explicitly that it is from the viewstate, however, when I remove the
> code for adding the data reader to the viewstate, I don't get the
> error. I'm not having any luck trying to troubleshoot this online.
>
Author
27 Feb 2007 6:27 PM
mianiro
Show quote
On Feb 12, 3:31 pm, "Kevin Spencer" <unclechut***@nothinks.com> wrote:
> A DataReader is not serializable as XML. If you want to store a result set
> in ViewState, use a DataTable or DataSet.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> Software Composerhttp://unclechutney.blogspot.com
>
> The shortest distance between 2 points is a curve.
>
> "mianiro" <mian***@gmail.com> wrote in message
>
> news:1171294851.369206.141640@a34g2000cwb.googlegroups.com...
>
>
>
> > Has anyone had a serialization error occur when adding a variable to a
> > viewstate?  The error states 'Error serializing value
> > 'System.Data.SqlClient.SqlDataReader' .  It does not mention
> > explicitly that it is from the viewstate, however, when I remove the
> > code for adding the data reader to the viewstate, I don't get the
> > error. I'm not having any luck trying to troubleshoot this online.- Hide quoted text -
>
> - Show quoted text -

Thank you! That worked

AddThis Social Bookmark Button