Hi,
I am trying to serialize an object to xml. It is killing med!
Imports System.IO
Imports System.Text
Imports System.Xml.Serialization
Public Class Tester
Public Shared Sub Main(ByVal Parms As Object)
Dim theSerializer As New XmlSerializer(GetType(employee))
Dim SGamgee As New employee("A", "G", "C")
Dim sw As New StreamWriter("data.xml")
theSerializer.Serialize(sw, SGamgee)
End Sub
End Class
Public Class employee
Public first_name As String
Public last_name As String
Public title As String
Public Sub New()
End Sub
Public Sub New(ByVal first_name As String, ByVal last_name As String, ByVal title As String)
Me.first_name = first_name
Me.last_name = last_name
Me.title = title
End Sub
End Class
Error: "VB.Net script exception(0), re-starting: Object reference not set to an instance of an object."
Other Errors that I have had:
- serializing non-public classes although they are declared public.
I am trying to serialize an object to xml. It is killing med!
Imports System.IO
Imports System.Text
Imports System.Xml.Serialization
Public Class Tester
Public Shared Sub Main(ByVal Parms As Object)
Dim theSerializer As New XmlSerializer(GetType(employee))
Dim SGamgee As New employee("A", "G", "C")
Dim sw As New StreamWriter("data.xml")
theSerializer.Serialize(sw, SGamgee)
End Sub
End Class
Public Class employee
Public first_name As String
Public last_name As String
Public title As String
Public Sub New()
End Sub
Public Sub New(ByVal first_name As String, ByVal last_name As String, ByVal title As String)
Me.first_name = first_name
Me.last_name = last_name
Me.title = title
End Sub
End Class
Error: "VB.Net script exception(0), re-starting: Object reference not set to an instance of an object."
Other Errors that I have had:
- serializing non-public classes although they are declared public.
Comment