473,322 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

reading and writing xml using a tcp stream

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
Nov 12 '05 #1
0 1697

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Hendrik Schober | last post by:
Hi, I have a 'std::istream' and need to read its whole contents into a string. How can I do this? TIA; Schobi
4
by: Oliver Knoll | last post by:
According to my ANSI book, tmpfile() creates a file with wb+ mode (that is just writing, right?). How would one reopen it for reading? I got the following (which works): FILE *tmpFile =...
3
by: Jon Brookins | last post by:
I'm reposting this question as the other post seems to have been sucked into the net black hole. I'll keep this short. I am trying to read and edit an Excel workbook in its native BIFF format. ...
3
by: Nick | last post by:
I have found a class that compresses and uncompresses data but need some help with how to use part of it below is the deflate method which compresses the string that I pass in, this works OK. At...
16
by: Ali | last post by:
Hi I want to write (or read) to a stream, but the data is not byte array I converted the data to byte array manually, but it is very slow, (becuse the data is very large) Is another way for this...
6
by: Neil Patel | last post by:
I have a log file that puts the most recent record at the bottom of the file. Each line is delimited by a \r\n Does anyone know how to seek to the end of the file and start reading backwards?
21
by: JoKur | last post by:
Hello, First let me tell you that I'm very new to C# and learning as I go. I'm trying to write a client application to communicate with a server (that I didn't write). Each message from the...
9
by: dba123 | last post by:
I need some help and direction on what classes and an example or two (article) on how to read an Excel Worksheet and insert one column into a database table column. I am using .NET 2.0 only. What...
21
by: Stephen.Schoenberger | last post by:
Hello, My C is a bit rusty (.NET programmer normally but need to do this in C) and I need to read in a text file that is setup as a table. The general form of the file is 00000000 USNIST00Z...
16
by: billsahiker | last post by:
I am researching for an upcoming c# .net 2.0 project that may require reading and writing xml files. I don't want to use xmltextreader/ xmltextwriter as I prefer to have lower level file access...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.