473,498 Members | 1,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deserialize from a string

Hi

Instead of deserializing (to XML object) from a file I would like to do the
same from a string where the data is already.

Thank you,
Samuel
Jun 27 '08 #1
8 831
On 2008-06-18, Samuel <sa************@ntlworld.comwrote:
Hi

Instead of deserializing (to XML object) from a file I would like to do the
same from a string where the data is already.

Thank you,
Samuel

Your going to have to be a little more explicit with your question... You say
that the data is already in a string? How did it get there? What is the
format of the string? etc.

--
Tom Shelton
Jun 27 '08 #2
Samual,

As the file is a text file, then it is a string, so what is the real
problem?

Cor

Jun 27 '08 #3
Currently I pass the XML Deserializer the FileStram that is 'connected' to
the file. What I need is a stream connected to the string

Thank you,
Samuel

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:3B**********************************@microsof t.com...
Samual,

As the file is a text file, then it is a string, so what is the real
problem?

Cor

Jun 27 '08 #4
The string contains the XML content instead of reading it from the XML file


"Tom Shelton" <to*********@comcastXXXXXXX.netwrote in message
news:WO******************************@comcast.com. ..
On 2008-06-18, Samuel <sa************@ntlworld.comwrote:
>Hi

Instead of deserializing (to XML object) from a file I would like to do
the
same from a string where the data is already.

Thank you,
Samuel


Your going to have to be a little more explicit with your question... You
say
that the data is already in a string? How did it get there? What is the
format of the string? etc.

--
Tom Shelton

Jun 27 '08 #5
On Jun 19, 8:33 am, "Samuel" <samuel.shul...@ntlworld.comwrote:
Currently I pass the XML Deserializer the FileStram that is 'connected' to
the file. What I need is a stream connected to the string

Thank you,
Samuel

"Cor Ligthert[MVP]" <notmyfirstn...@planet.nlwrote in message

news:3B**********************************@microsof t.com...
Samual,
As the file is a text file, then it is a string, so what is the real
problem?
Cor
Use a StringStream instead of a FileStream. That should work.

Chris
Jun 27 '08 #6
Samuel wrote:
Instead of deserializing (to XML object) from a file I would like to
do the same from a string where the data is already.
Would an XMLTextReader do?
http://support.microsoft.com/kb/301228

Andrew
Jun 27 '08 #7
On Jun 19, 8:33 am, "Samuel" <samuel.shul...@ntlworld.comwrote:
Currently I pass the XML Deserializer the FileStram that is 'connected' to
the file. What I need is a stream connected to the string

Thank you,
Samuel

"Cor Ligthert[MVP]" <notmyfirstn...@planet.nlwrote in message

news:3B**********************************@microsof t.com...
Samual,
As the file is a text file, then it is a string, so what is the real
problem?
Cor
I meant StringReader, not StringStream. You can pass an instance of
a StringReader into the Deserialize method of the XmlSerializer.

Chris
Jun 27 '08 #8
Samuel,

Based on a message from Tom Shelton

http://www.vb-tips.com/SerializeDataSet.aspx

Cor

"Samuel" <sa************@ntlworld.comschreef in bericht
news:uk**************@TK2MSFTNGP05.phx.gbl...
The string contains the XML content instead of reading it from the XML
file


"Tom Shelton" <to*********@comcastXXXXXXX.netwrote in message
news:WO******************************@comcast.com. ..
>On 2008-06-18, Samuel <sa************@ntlworld.comwrote:
>>Hi

Instead of deserializing (to XML object) from a file I would like to do
the
same from a string where the data is already.

Thank you,
Samuel


Your going to have to be a little more explicit with your question...
You say
that the data is already in a string? How did it get there? What is the
format of the string? etc.

--
Tom Shelton

Jun 27 '08 #9

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

Similar topics

2
9508
by: Greg | last post by:
I'm writing a class in C# .... I have a collection calls Reports made up of Report objects. I'm trying to deserialize an XML file that looks like : <Reports> <Report> <Title>some title</Title>...
2
6028
by: PCH | last post by:
I have 2 functions, one to serialize an object, and one to deserialize it. I can serialize just fine, the problem is when I try to deserialize it later... I get an error: {"Invalid...
0
2055
by: Fruber Malcome | last post by:
I'm getting a very weird exception and hoping someone may be able to help. I have an Office Add-In that lives in a .dll (for email reference ai.dll) ai.dll makes calls into the core part of the...
4
3292
by: George Addison | last post by:
I understand this might not be the optimal method of deserialization, but how can I deserialize a class to itself? Something like: Public Sub New(Optional ByVal filename as string = Nothing)...
1
1804
by: Stephen Travis | last post by:
I would like an Object's Constructor to create itself by deserializing from XML. Is there an easy way to do this? I could use a separate function to deserialize to an object but I'd like to do it...
0
2053
by: John Manion via .NET 247 | last post by:
Long Post, thanks for your patience... I have and XML file that looks something like this: <?xml version="1.0" encoding="utf-8" ?> <Settings> <Location> <X>30</X> <Y>40</Y> </Location>...
0
4066
by: Matt S | last post by:
Hello, I'm trying to build a C# client to consume an AXIS Web Service (running SOAP over HTTP). The Web Service encodes full server-side exception traces in the Soap Fault > Detail element...
2
11513
by: Thomas S | last post by:
Any suggestions on how to deserialize an object from one line of XML? I'm trying to deserialize multiple objects from one XML document, each object on one line of the file. The serialization is...
4
4626
by: Anbu | last post by:
Hi All, I need to Deserialize the SoapService's SoapEnvelope response object. Here is the Body of the SoapEnvelope received as respone, <q1:serviceResponse...
11
2796
by: wpmccormick | last post by:
I've a complex problem: I'm deserializing a very long string of XML into a very large object foo: <foo> ....... <bar>sometimes a simple string is here</bar> ....... </foo>
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.