Results 1 to 5 of 5

Thread: datagridview

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    datagridview

    I have a string which represents data in xml format.
    How can I show this string into a gridview please?
    So basically I would like to populate a datagridview with the xml data which is inside the string.
    Thanks

  2. #2
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: datagridview

    Load the .xml file into a new dataset and bind it to the datagridview.
    Last edited by Asgorath; Mar 9th, 2007 at 12:04 PM.
    "The dark side clouds everything. Impossible to see the future is."

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    Re: datagridview

    please note that my data is not .xml
    It is a string which has xml data in it. i.e. representation of data in xml format but in a long string.
    Thanks

  4. #4
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: datagridview

    You can try something like this (code from memory, didn't test it... So I'm neither sure the syntax is correct nor it'll work)
    vb Code:
    1. Dim dt As New DataTable
    2. Dim xmlString As String = "you xml string"
    3. Dim reader As New StringReader(xmlString)
    4. dt.ReadXml(reader)
    5. DataGridView1.DataSource = dt

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    Re: datagridview

    Thanks
    Last edited by fmardani; Mar 9th, 2007 at 06:14 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width