Solved

Saving data to a csv file from an asp web page

Posted on 2007-04-11
5
647 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
Comment Utility
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
Comment Utility
0
 
LVL 18

Expert Comment

by:Ajay Sharma
Comment Utility
0
 

Author Comment

by:BigCap
Comment Utility
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
Comment Utility
Glad to have been helpful BigCap,

Regards,
Max.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
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.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now