PC Review

Thread Tools Rate Thread

How to read a Stream into an XElement

Anthony P.
Posts: n/a
      18th Apr 2010
I'm writing an application where I want to use Linq2XML to read a
simple bit of XML that's returned after executing a simple
HttpWebRequest. Once I execute the request and attach a response
stream, I'm executing this code to try to get the XML that's returned
into a standard string

Dim xmlReturnString as String = response.ReadToEnd()

After that, I'm then trying to attach that to an XElement like this:

Dim oXElement as XElement = xmlReturnString

On this statement, I get told that I can't convert a string into an

How can I get the returned XML into an XElement so I can run some Linq
queries on it?

Reply With Quote

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting XML nodes w/ namespace and XElement Michael Bray Microsoft C# .NET 11 10th Jul 2008 05:45 PM
XElement, XAttribute Default Values Rory Becker Microsoft VB .NET 4 25th Jun 2008 12:44 PM
LINQ XElement.load method not working correctly with strings withperiods in them Mike N. Microsoft C# .NET 2 4th Jun 2008 03:37 AM
DataBinding CheckBoxList to an XElement Andy B Microsoft ASP .NET 0 20th May 2008 08:11 AM
XElement questions CSharper Microsoft C# .NET 4 14th May 2008 03:12 PM




All times are GMT +1. The time now is 12:43 PM.