Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 30th, 2007, 01:13 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
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.

  #2 (permalink)  
Old August 31st, 2007, 08:51 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:03 PM.


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