-2
<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
Emmanuel DURIN
  • 4,803
  • 2
  • 28
  • 53

1 Answers1

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