Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   parsing a cvs stream from an http request (http://www.velocityreviews.com/forums/t368497-parsing-a-cvs-stream-from-an-http-request.html)

sollento 09-04-2006 04:41 PM

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


Cowboy \(Gregory A. Beamer\) 09-04-2006 05:06 PM

Re: parsing a cvs stream from an http request
 
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" <hani_ar@hotmail.com> wrote in message
news:1157388099.136646.215760@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
>




sollento 09-05-2006 11:48 AM

Re: parsing a cvs stream from an http request
 
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" <hani_ar@hotmail.com> wrote in message
> news:1157388099.136646.215760@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
> >



Edwin Knoppert 09-05-2006 03:03 PM

Re: parsing a cvs stream from an http request
 
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)" <NoSpamMgbworld@comcast.netNoSpamM> schreef in
bericht news:uOMl$RE0GHA.1536@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" <hani_ar@hotmail.com> wrote in message
> news:1157388099.136646.215760@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
>>

>
>





All times are GMT. The time now is 08:32 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.