How to read a Stream into an XElement

Discussion in 'Microsoft VB .NET' started by Anthony P., Apr 18, 2010.

  1. Anthony P.

    Anthony P. Guest

    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
    XElement.

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

    Thanks!
    Anthony
     
    Anthony P., Apr 18, 2010
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Giuseppe

    File To Stream - Stream To File

    Giuseppe, Mar 23, 2005, in forum: Microsoft VB .NET
    Replies:
    3
    Views:
    342
    Cor Ligthert
    Mar 23, 2005
  2. Inspired

    stuck into Stream.Read plz HELP !

    Inspired, Nov 29, 2005, in forum: Microsoft VB .NET
    Replies:
    0
    Views:
    144
    Inspired
    Nov 29, 2005
  3. Jack
    Replies:
    2
    Views:
    429
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jul 18, 2007
  4. Rory Becker

    XElement, XAttribute Default Values

    Rory Becker, Jun 19, 2008, in forum: Microsoft VB .NET
    Replies:
    4
    Views:
    516
    Rory Becker
    Jun 25, 2008
  5. John Meyer

    XElement hell

    John Meyer, Jul 10, 2008, in forum: Microsoft VB .NET
    Replies:
    0
    Views:
    193
    John Meyer
    Jul 10, 2008
Loading...

Share This Page