Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 30th, 2007, 01:13 AM
Authorized User
 
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default viewstate error

hi all,

I am trying to store dataview in viewstate but it through an error

Type 'System.Data.DataView' in Assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.

could anyone help me out plz.

Thanks in Advance.

 
Old August 31st, 2007, 08:51 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The error message explains it all. The DataView class is not serializable. In order to store a value in viewstate, it must be serializable. The underlying datatable of the dataview can be serialized however. Then you would just need to re-apply any filter or sorting to the default dataview.

I'm concerned that you are storing datatable type data in viewstate. Explain what you are doing, there might be a better way.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Viewstate Wervis BOOK: ASP.NET Website Programming Problem-Design-Solution 0 November 30th, 2005 09:42 AM
ViewState abdul_owiusa General .NET 0 October 18th, 2005 04:37 PM
ViewState burhan ASP.NET 1.0 and 1.1 Basics 4 June 6th, 2004 04:25 AM
Viewstate Invalid Error mahulda ASP.NET 1.0 and 1.1 Basics 0 February 20th, 2004 11:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.