Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Saving data to a csv file from an asp web page

Posted on 2007-04-11
5
Medium Priority
?
660 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 19

Accepted Solution

by:
DreamMaster earned 1000 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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

636 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