Export Gridview with SQL Datasource to XML

M

Mark B

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.OutputStream?
 
M

Mark Fitzpatrick

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
 
M

Mark B

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top