type 'system.data.dataview' in assembly 'system.data is not marked as serializable

rajasoorya_kc
rajasoorya_kc used Ask the Experts™
on
I get the error "type 'system.data.dataview' in assembly 'system.data is not marked as serializable". What has to be done?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
A view is just a view, it holds no data in itself. Serialize the source of your dataview instead?
When do you get this error? I'm curious why you need to serialize a dataview. Is it when you are trying to add it to the Session? If so, what type of session management are you using?

Author

Commented:
i'm getting data Data from DB and filtering this data according to certain criteria... i need to pass only this filtered data across pages to be used by other pages ... so i'm putting this view in a session ... This works fine when i run the same as web application but throws me the above error when i integrate it with MOSS
Ok. Thanks for the background. I agree with djjaries. Because DataView is not serializable, serialize the underlying DataTable, which is serializable.

If you want this application highly scalable for a lot of users, you don't want to put massive amounts of data in the Session anyway. In that case, consider just passing the search criteria in the session. If performance is an issue due to retrieving the data multiple times, consider a database view to have the filtered data quicker to retrieve.

Author

Commented:
The suggestion helped

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial