Adagio
Well-known member
- Joined
- Dec 12, 2005
- Messages
- 162
- Programming Experience
- Beginner
I have a bit of a problem here and hope somebody here can help me figure out what the problem is
I have a class called Truck and a form called frmTruck
I have some code like this in a method. It recieves obj as Truck
To simplify my code, I have basically something like this for frmTruck:
During the LoadTruckFromDatabase function I call the SerializeTruck method, here everything goes fine. But when I call the SerializeTruck just before End sub of DoSomething, it goes wrong
I get an exception saying that frmTruck is not serializable
My truckinstance doesn't have any references to frmTruck... or at least not as far as I can see... and there shouldn't be any
Is there a way how to figure out at what point it goes wrong, so I can figure out what part of the Truck object it doesn't like?
I have a class called Truck and a form called frmTruck
I have some code like this in a method. It recieves obj as Truck
VB.NET:
Dim ms As New MemoryStream(1000)
Dim bf As New BinaryFormatter(Nothing, New StreamingContext(StreamingContextStates.Clone))
bf.Serialize(ms, obj)
To simplify my code, I have basically something like this for frmTruck:
VB.NET:
public class frmTruck
private truckValue as Truck
public sub DoSomething()
truckValue = LoadTruckFromDatabase()
SerializeTruck(truckValue)
End sub
End class
During the LoadTruckFromDatabase function I call the SerializeTruck method, here everything goes fine. But when I call the SerializeTruck just before End sub of DoSomething, it goes wrong
I get an exception saying that frmTruck is not serializable
My truckinstance doesn't have any references to frmTruck... or at least not as far as I can see... and there shouldn't be any
Is there a way how to figure out at what point it goes wrong, so I can figure out what part of the Truck object it doesn't like?