serializable

Can I store xmlDocument object in ViewState?

Hi, I have one XML document which I want to store it inside ViewState so on each post back I do not need to load it from its physical path again. I do not want to store it in SessionState as well. when I tried to srote it in ViewState I get an error: Exception Details: System.Runtime.Serialization.SerializationException: Type 'System....

Serialize ComponentModel.Container???

Is it possible to serialize (binary) a System.ComponentModel.Container? ...

how can we have a serializable object?

Hi, I have a question that for example I have a GameStartegy class that has 53 fields and the type of all is one interface for example Strategy and one of these fields are Date and the will be initialized when we create an object,how can i create a Serializable object ?? should I serialize all fields like Date? thanks ...

When does it make sense for a Java object to be Serializable but not Cloneable?

If a Java class implements the Serializable interface but does not have a public clone() method, it is usually possible to create a deep copy like this: class CloneHelper { @SuppressWarnings("unchecked") public static <T extends Serializable> T clone(T obj) { try { ByteArrayOutputStream baos = new ByteArrayOu...

How to Serialize a ASP.NET UserControl

I have a application with a GridView, this GridView have, in your PagerTemplate, a GridViewPager which is an UserControl. Now i'am trying to store this GridViewPager in a ViewState and i'am having a problem with serialization. Asp.Net tell me that the class is not marked as serializable. I try to mark it as serializable, like this: nam...

What does it mean: The serializable class does not declare a static final serialVersionUID field?

I have the warning message given in the title. I would like to understand and remove it. I found already some answers on this question but I do not understand these answers because of an overload with technical terms. Is it possible to explain this issue with simple words? P.S. I know what OOP is. I know what is object, class, method, f...

Serialize/Save control property(ex:TextBox.Text) to a custom config file

Hello, I'm working on a small program and I would like to save some control states and properties into a configuration file. However I don't want to use the "traditional" settings file due to several reasons, but rather have it serialized or simply saved into a specific file. For example get window1's TextBox1.Text and serialize it, so...

serializable to derived classes

Is there an easy way to enforce a derived class must be serialiable? Suppose I define a interface that needs the derived classes to be serializable. According to this post, I cannot just specify the serializable attribute in the interface, because derived classes don't need to respect that. I believe I could have the interface inherit ...

Error during Team Build: The type or namespace name 'Serializable' could not be found

New problem with VS2005 Team Build: Building locally a solution of a mobile client for a platform of the company, everything goes pretty neat and compilation occurs without major hiccups, but using the very same solution on a Team Build gives me the following problem: Solution: TB Client.sln, Project: Client.PocketPC.UIAPI.csproj,...

Rename serializable class

If i Serializable the following code using XmlSerializer. [XmlRoot("products")] public class Products : List<Product> { } public class Product { } I get the following xml <ArrayOfProduct> <Product/> </ArrayOfProduct> How to i write to get the following naming of the tags (products and lower case product)? <products> <product/>...

How to make a class serializable without Serializable attibute in .net

Hello All: I have one debugger visualizer for seeing list of class object in the form of data table. But the limitation for the code is that the class should be serializable i.e. should be marked as [Serializable] and if the class is not marked Serializable then the debugger crashes. So, can anybody tell me how to make a class Serializa...

Why can't I use WCF DataContract and ISerializable on the same class?

Hi all, I have a class that I need to be able to serialize to a SQLServer session variable and be available over a WCF Service. I have declared it as follows namespace MyNM { [Serializable] [DataContract(Name = "Foo", Namespace = "http://www.mydomain.co.uk")] public class Foo : IEntity, ISafeCopy<Foo> { [DataMember(Order = 0)] ...

Using serializable in hibernate what underlying database types do i use.

I need to use a serializable type in hibernate (to store a Subject (security)) All this works fine. I just need to know what the underlying database types are for the following databases: MSSQL - I used 'image' db2 - postgre - mysql - Thanks.. ...

Why do you have to mark a class with the attribute [serializable] ?

Seeing as you can convert any document to a byte array and save it to disk, and then rebuild the file to its original form (as long as you have meta data for its filename etc.). Why do you have to mark a class with [Serializable] etc? Is that just the same idea, "meta data" type information so when you cast the object to its class thin...

Persist an object that is not marked as serializable

Hi, I need to persist an object that is not marked with the serializable attribute. The object is from a 3rd party library which I cannot change. I need to store it in a persist place, like for example the file system, so the optimal solution would be to serialize the object to a file, but since it isn't marked as serializable, that is...

Variable reference problem when loading an object from a file in Java

I have a problem with the reference of a variable when loading a saved serialized object from a data file. All the variables referencing to the same object doesn't seem to update on the change. I've made a code snipped below that illustrates the problem. Tournament test1 = new Tournament(); Tournament test2 = test1; try { ...

How to mock ISerializable classes with Moq?

Hi there, I'm completly new to Moq and now trying to create a mock for System.Reflection.Assembly class. I'm using this code: var mockAssembly = new Mock<Assembly>(); mockAssembly.Setup( x => x.GetTypes() ).Returns( new Type[] { typeof( Type1 ), typeof( Type2 ) } ); But when I run tests I get next exception: System.A...

Do Hibernate table classes need to be Serializable?

I have inherited a Websphere Portal project that uses Hibernate 3.0 to connect to a SQL Server database. There are about 130 Hibernate table classes in this project. They all implement Serializable. None of them declare a serialVersionUID field, so the Eclipse IDE shows a warning for all of these classes. Is there any actual need for t...

[Android] Putting Serializable Classes into SQL?

Here's the situation. I have a bunch of objects that implement Serializable that I want to store in a SQL database. I have two questions Is there a way to serialize the object directly into the database Is that the best way to do it or should I Write the object out to a formatting String and put it in the database that way and then...

How is FileInfo Serialized?

I want to save file metadata (mostly path/name) along with the contents of the file. I noticed that FileInfo is serializable. Does anyone know data is serialized when you save a FileInfo object? I would assume that only metadata is saved, not the contents of the file? ...