R
Rob Panosh
Hello,
I am trying to create a xmlDocument from as dataset. My code is listed
below. All seems to go well until
xmlDocument.Load(CType(ms, System.IO.Stream)) ... I keep getting the
following error "The Root Element is Missing" ... any help would be
appreciated.
Thanks,
Rob Panosh
Public Function GetXMLDocument() As System.String
Dim xDataSet As New System.Data.DataSet
Dim xmlDocument As New System.Xml.XmlDocument
Dim ms As New System.IO.MemoryStream ' = Nothing
Dim ser As System.Xml.Serialization.XmlSerializer
Dim t As System.Type
t = GetType(System.Data.DataSet)
ser = New System.Xml.Serialization.XmlSerializer(t) '
System.Type.GetType("System.Data.DataSet"))
'Filled with data adapter.
Me.Execute(xDataSet, "test")
ser.Serialize(ms, xDataSet)
xmlDocument.Load(CType(ms, System.IO.Stream))
End Function
I am trying to create a xmlDocument from as dataset. My code is listed
below. All seems to go well until
xmlDocument.Load(CType(ms, System.IO.Stream)) ... I keep getting the
following error "The Root Element is Missing" ... any help would be
appreciated.
Thanks,
Rob Panosh
Public Function GetXMLDocument() As System.String
Dim xDataSet As New System.Data.DataSet
Dim xmlDocument As New System.Xml.XmlDocument
Dim ms As New System.IO.MemoryStream ' = Nothing
Dim ser As System.Xml.Serialization.XmlSerializer
Dim t As System.Type
t = GetType(System.Data.DataSet)
ser = New System.Xml.Serialization.XmlSerializer(t) '
System.Type.GetType("System.Data.DataSet"))
'Filled with data adapter.
Me.Execute(xDataSet, "test")
ser.Serialize(ms, xDataSet)
xmlDocument.Load(CType(ms, System.IO.Stream))
End Function