Export Gridview with SQL Datasource to XML

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark B

    #1

    Export Gridview with SQL Datasource to XML

    I've got a sales figure gridview with a SQLDataSource.

    I need to pass the data to Flash World Map so the sales figures can be
    overlaid on each country.

    Flash reads XML files.

    How can I easily save the GridView into XML format for Flash to read? Also,
    rather than save it as a file, how would I use Response.Output Stream?

  • Mark Fitzpatrick

    #2
    Re: Export Gridview with SQL Datasource to XML

    I would think you wouldn't want to be exporting a GridView because that is
    formatted XML. You should probably be formatting the data used to populate
    the gridview into XML. If you're using Sql Server as your DB, it already
    comes with features that let you create XML resultsets using the FOR XML
    clause. Take a look at the FOR XML section of the SQL Server docs for more
    information as it's tricky to explain. You'll need to match up the XML
    format that you generate with what Flash expects. It's one thing to say
    Flash reads XML, but you need to know exactly which nodes it expects so you
    can format your sql query properly to get the right output.

    Hope this helps,
    Mark Fitzpatrick

    "Mark B" <none123@none.c omwrote in message
    news:uqHWMnhIJH A.456@TK2MSFTNG P06.phx.gbl...
    I've got a sales figure gridview with a SQLDataSource.
    >
    I need to pass the data to Flash World Map so the sales figures can be
    overlaid on each country.
    >
    Flash reads XML files.
    >
    How can I easily save the GridView into XML format for Flash to read?
    Also, rather than save it as a file, how would I use
    Response.Output Stream?

    Comment

    • Mark B

      #3
      Re: Export Gridview with SQL Datasource to XML

      Thanks. The trouble with going from SQL straight to XML for us is that we
      have some complex VB.NET functions that we have created that we perform on
      the grid-view's fields and output them as template fields in the same
      Gridview. I was hoping not to have to try and translate these functions into
      SQL at the source so as to save time.



      "Mark Fitzpatrick" <markfitz@fitzm e.comwrote in message
      news:uYOqV6hIJH A.740@TK2MSFTNG P03.phx.gbl...
      >I would think you wouldn't want to be exporting a GridView because that is
      >formatted XML. You should probably be formatting the data used to populate
      >the gridview into XML. If you're using Sql Server as your DB, it already
      >comes with features that let you create XML resultsets using the FOR XML
      >clause. Take a look at the FOR XML section of the SQL Server docs for more
      >information as it's tricky to explain. You'll need to match up the XML
      >format that you generate with what Flash expects. It's one thing to say
      >Flash reads XML, but you need to know exactly which nodes it expects so you
      >can format your sql query properly to get the right output.
      >
      Hope this helps,
      Mark Fitzpatrick
      >
      "Mark B" <none123@none.c omwrote in message
      news:uqHWMnhIJH A.456@TK2MSFTNG P06.phx.gbl...
      >I've got a sales figure gridview with a SQLDataSource.
      >>
      >I need to pass the data to Flash World Map so the sales figures can be
      >overlaid on each country.
      >>
      >Flash reads XML files.
      >>
      >How can I easily save the GridView into XML format for Flash to read?
      >Also, rather than save it as a file, how would I use
      >Response.Outpu tStream?
      >

      Comment

      Working...