Hi,
I am writing a client/server application with a desktop and a pocketPC
which transfers a xml string which is to be loaded by a dataset on the
client.
the server uses this code to prepare and send the xml:
Dim stringbuilder As New StringBuilder
Dim textwriter As StringWriter = New StringWriter(stringbuilder)
Dim xmltextwriter As New Xml.XmlTextWriter(textwriter)
xmltextwriter.Formatting = Xml.Formatting.Indented
Dataset.WriteXml(xmltextwriter, XmlWriteMode.WriteSchema)
'this is the connection to the client
Dim w As New IO.StreamWriter(mobjClient.GetStream)
' the "#!!#" is used to separate my commands to the client and the
'cargo the stringbuilder.ToString
'the @ tells the client that this package is complete
w.Write(ServerMessage & "#!!#" & stringbuilder.ToString & "@")
w.Flush()
The Client code to receive and load is:
''connect stream with streamreader
Dim nt As Xml.NameTable = New Xml.NameTable
Dim nsmanager As New Xml.XmlNamespaceManager(nt)
Dim context As New Xml.XmlParserContext(nt, nsmanager, "de-DE",
Xml.XmlSpace.Default, System.Text.Encoding.UTF8)
Dim reader As New Xml.XmlTextReader(ReveicedString,
Xml.XmlNodeType.Document, context)
'create dataset from xml
Me.frmMain.receivedData.ReadXml(reader, XmlReadMode.ReadSchema)
He tells me that he expects 'EndElement'
What could I do to send/receive a nice working xml picture of the dataset?
Thank you very much in advance.
--
Message posted via http://www.dotnetmonster.com