How to serialize a Linq To sql class

How to serialize a Linq To sql class

Old forum URL: forums.lhotka.net/forums/t/9199.aspx


vbbeta posted on Sunday, July 11, 2010

I have a problem when using a Linq to sql class to fetch data but at runtime it givse me a runtime exception that class XYZ is not serialized.  i would like to know if someone could help with this

ajj3085 replied on Sunday, July 11, 2010

If youre trying to serialize the DataContext, you're not going to get that to work.  Its just not serializable.  If its one of your data classes, just slap [Serializable] on the class XYZ and it should work... although you might want to rethink bringing that class back, as that will start requiring what should be server side only assemblies on your client.

Copyright (c) Marimer LLC