Solved

Saving data to a csv file from an asp web page

Posted on 2007-04-11
5
648 Views
Last Modified: 2008-01-09
I have data retrieved from SQL via the following

        Dim dsData As New SqlDataSource
        With dsData
            .ConnectionString = OdfosDB.strConnectionString
            .SelectCommandType = SqlDataSourceCommandType.StoredProcedure
            .SelectCommand = "spSales"
            .SelectParameters.Clear()

            .SelectParameters.Add("PCTId", PctIdValue)
            .DataSourceMode = SqlDataSourceMode.DataReader
        End With

Which does return data as I've displayed it in a grid via
      gvData.DataSource = dsData
        gvData.DataBind()

I need to save the data to a csv file on the local PC.

Any ideas?
0
Comment
Question by:BigCap
5 Comments
 
LVL 19

Accepted Solution

by:
DreamMaster earned 250 total points
ID: 18887987
The article on this page should get you on your way, eventhough it is applied to a datagrid and not a gridview:

http://www.dotnetbips.com/articles/668a7110-378c-45f7-8f93-a89ea5c82cd0.aspx
0
 
LVL 18

Expert Comment

by:Sham Haque
ID: 18887992
0
 
LVL 18

Expert Comment

by:Ajay Sharma
ID: 18888012
0
 

Author Comment

by:BigCap
ID: 18888378
Thanks to you all - but I will give points to DreamMaster as that is the one I used.

It worked just fine.

But thanks again to gbshahaq and ajaysharmaapis - I will look at those also sometime
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 18888402
Glad to have been helpful BigCap,

Regards,
Max.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sql server get data from a usp to use in a usp 5 16
Deal with apostrophe in stored procedures 8 42
optimize stored procedure 6 28
SQL Server Error 21 8 25
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question