elmbrook
asked on
Downloading CSV file from webservice
I have been asked by a client to access information from a web service.
They have given me the following access code
What is the best way to get this information into a datatable so I can display this in a datagrid?
Do I have to loop through each line and split the comma separated values?
How do I save this as a CSV file?
They have given me the following access code
WebRequest request = WebRequest.Create( "http://www.odata.charities.govt.nz/GrpOrgLatestReturns?$filter=Donationskoha gt 1000000&$format=csv");
WebResponse Response = request.GetResponse();
What is the best way to get this information into a datatable so I can display this in a datagrid?
Do I have to loop through each line and split the comma separated values?
How do I save this as a CSV file?
ASKER
I should have been more detailed.
I need to run this from a windows application where the user can set a number of filters to download the information.
I then need to display this in a datagridview so the user can see what they have downloaded.
I need to run this from a windows application where the user can set a number of filters to download the information.
I then need to display this in a datagridview so the user can see what they have downloaded.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Used another solution I found. Have to credit this articel http://stackoverflow.com/questions/1050112/how-to-read-a-csv-file-into-a-net-datatable
http://www.odata.charities.govt.nz/GrpOrgLatestReturns?$filter=Donationskoha gt 1000000&$format=csv
I just did that. File attached for reference.
GrpOrgLatestReturns.csv