Solved

Saving data to a csv file from an asp web page

Posted on 2007-04-11
5
650 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
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…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

856 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