<Serializable()> Public Structure structResult
Public ResultID As Integer
Public SurveyID As Integer
Public QuestionID As Integer
Public AnswerID As Integer
Public Text As String
Public ModifierID As Integer
Public ModifiedDate As DateTime
End Structure
Asked
Active
Viewed 781 times
-2

Emmanuel DURIN
- 4,803
- 2
- 28
- 53

r.suresh kumar
- 1
- 1
-
why structures are serializing in .net? – r.suresh kumar Nov 14 '15 at 10:42
-
What is your question : " Why my structure is serializable ? " ??? – Emmanuel DURIN Nov 14 '15 at 11:10
-
yes generally why structures are serializing in project? what is the advantage by serializing this structures – r.suresh kumar Nov 14 '15 at 12:58
-
Just to be clear; you understand what Serialization is, yes? If so, then you already know the answer to your question. If not, I suggest you read up on the subject. It's a handy technique, and essential for distributed systems. – Jonathon Cowley-Thom Nov 16 '15 at 16:10
1 Answers
1
Serialization is useful for saving objects :
In files or other persistent storage.
Useful for restoring the state of an application.In socket streams for sending an object from a client to a server (or reverse).
Serialization is also interesting because it allows to save object graphs quite easily.
For instance a Car has an Engine.
When the Car is saved, the Engine is also saved
Structures
can be serialized, but also classes
of course.
The serialization you show in your code excerpt uses standard CLR serialization.
But there is also DataContractSerializer
with the and attributes, and some few more (JSON.Net, ...)
Regards

dbc
- 104,963
- 20
- 228
- 340

Emmanuel DURIN
- 4,803
- 2
- 28
- 53