473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

parsing a cvs stream from an http request

Hello,

I am writing an asp.net application to retrieve a cvs file from an http
request and populate a dataset. Can someone provide sample code or a
reference example.

Step 1: http request to a web site (yahoo finance stock historical
quotes which returns a csv file -
http://ichart.finance.yahoo.com/tabl...02&ignore=.csv)

Step 2: parse the file and store in a dataset
Thank you in advance

Sep 4 '06 #1
3 3865
1. Request page
2. Put into a store (this can be as simple as saving to your drive or you
can choose a memory stream to hold in memory)
3. Read from the store (use a stream object; memory stream for in memory
storage, streamreader for file system -- the second is a bit easier)
4. Use ADO.NET to read the file (Jet provider) into the DataSet
5. (optional) If you saved the file downloaded, delete it

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
"sollento" <ha*****@hotmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hello,

I am writing an asp.net application to retrieve a cvs file from an http
request and populate a dataset. Can someone provide sample code or a
reference example.

Step 1: http request to a web site (yahoo finance stock historical
quotes which returns a csv file -
http://ichart.finance.yahoo.com/tabl...02&ignore=.csv)

Step 2: parse the file and store in a dataset
Thank you in advance

Sep 4 '06 #2
Thank you. I would be grateful if you could let me know which functions
to use for 1 to 3. I know how to do 4.

Thank you in advance

Cowboy (Gregory A. Beamer) wrote:
1. Request page
2. Put into a store (this can be as simple as saving to your drive or you
can choose a memory stream to hold in memory)
3. Read from the store (use a stream object; memory stream for in memory
storage, streamreader for file system -- the second is a bit easier)
4. Use ADO.NET to read the file (Jet provider) into the DataSet
5. (optional) If you saved the file downloaded, delete it

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
"sollento" <ha*****@hotmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hello,

I am writing an asp.net application to retrieve a cvs file from an http
request and populate a dataset. Can someone provide sample code or a
reference example.

Step 1: http request to a web site (yahoo finance stock historical
quotes which returns a csv file -
http://ichart.finance.yahoo.com/tabl...02&ignore=.csv)

Step 2: parse the file and store in a dataset
Thank you in advance
Sep 5 '06 #3
To download a file you can use
My.Computer.Network.DownloadFile(...)
but only VB code can be used, not supported in c#, so a simple compiled
assembly to be used in your c# app should do.
This is the easiest however, it does not harm to dive into the webrequest()
stuff, at some point you'll need to contact and post data to other
webservers is my assumption (as i have)
Once the csv is downloaded (tempfile or so) you can open it via ado.net, see
www.connectionstrings.com for hints on the extra params.


"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMschreef in
bericht news:uO**************@TK2MSFTNGP02.phx.gbl...
1. Request page
2. Put into a store (this can be as simple as saving to your drive or you
can choose a memory stream to hold in memory)
3. Read from the store (use a stream object; memory stream for in memory
storage, streamreader for file system -- the second is a bit easier)
4. Use ADO.NET to read the file (Jet provider) into the DataSet
5. (optional) If you saved the file downloaded, delete it

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
"sollento" <ha*****@hotmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
>Hello,

I am writing an asp.net application to retrieve a cvs file from an http
request and populate a dataset. Can someone provide sample code or a
reference example.

Step 1: http request to a web site (yahoo finance stock historical
quotes which returns a csv file -
http://ichart.finance.yahoo.com/tabl...02&ignore=.csv)

Step 2: parse the file and store in a dataset
Thank you in advance


Sep 5 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Garyrek | last post by:
Hi I have an url where I have xml data POSTED and I need to parse the URL to read the data - Meanwhile here is my xml data =================================== <?xml version="1.0"...
1
by: Dan Corkum | last post by:
Good morning. I am working on an issue that is just baffling me. I have developed an .aspx page that receives an http form post that has a "file" attribute. When I do testing with a test post...
1
by: DLOC | last post by:
Hi all, I am building a small web server proxy and am wondering if there is an HTTP request parser that I can leverage from the .NET Framework in C#. The goal would be to pass in a raw request...
0
by: Dan Corkum | last post by:
Good morning. I am working on an issue that is just baffling me. I have developed an .aspx page that receives an http form post that has a "file" attribute. When I do testing with a test post...
4
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. It is greatly appreciated. I am working with Plimus for licensing my software. I can communicate with the server and I'm getting responses in XML....
2
by: Cuong.Tong | last post by:
Greeting, Can anyone give me some hints about parsing the mulitpart/form-data stream? I have a form looks something like this <form action="process.dll> <input type=file...
3
by: Cuong.Tong | last post by:
Greeting, I am writing my own web server and having some problme parsing the the mulitpart/form-data stream that is sent from the browsers. I have a form looks something like this <form...
3
by: toton | last post by:
Hi, I have some ascii files, which are having some formatted text. I want to read some section only from the total file. For that what I am doing is indexing the sections (denoted by .START in...
0
by: vishnu | last post by:
Hi, Am trying to post the data over https and am getting error in httpwebresponse.getResponseStream.Please help me to get rid of this issue. Here is the message from immediate window ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.