?
Solved

Saving data to a csv file from an asp web page

Posted on 2007-04-11
5
Medium Priority
?
657 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

765 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