parsing a cvs stream from an http request

Discussion in 'ASP .Net' started by sollento, Sep 4, 2006.

  1. sollento

    sollento Guest

    sollento, Sep 4, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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/table.csv?s=RIO&d=8&e=4&f=2006&g=d&a=2&b=21&c=2002&ignore=.csv)
    >
    > Step 2: parse the file and store in a dataset
    >
    >
    > Thank you in advance
    >
    Cowboy \(Gregory A. Beamer\), Sep 4, 2006
    #2
    1. Advertising

  3. sollento

    sollento Guest

    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" <> wrote in message
    > news:...
    > > 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/table.csv?s=RIO&d=8&e=4&f=2006&g=d&a=2&b=21&c=2002&ignore=.csv)
    > >
    > > Step 2: parse the file and store in a dataset
    > >
    > >
    > > Thank you in advance
    > >
    sollento, Sep 5, 2006
    #3
  4. 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)" <> schreef in
    bericht news:uOMl$...
    > 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" <> wrote in message
    > news:...
    >> 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/table.csv?s=RIO&d=8&e=4&f=2006&g=d&a=2&b=21&c=2002&ignore=.csv)
    >>
    >> Step 2: parse the file and store in a dataset
    >>
    >>
    >> Thank you in advance
    >>

    >
    >
    Edwin Knoppert, Sep 5, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QWFyb24gR3Vv?=

    How to parse the input stream of http request?

    =?Utf-8?B?QWFyb24gR3Vv?=, Dec 12, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    945
    John Timney \( MVP \)
    Dec 12, 2005
  2. ddog
    Replies:
    3
    Views:
    576
    Jason Whaley
    Aug 4, 2007
  3. Replies:
    1
    Views:
    583
    GArlington
    Aug 31, 2007
  4. David Ross
    Replies:
    5
    Views:
    141
    Nicholas Van Weerdenburg
    Dec 5, 2004
  5. Greg Hauptmann
    Replies:
    1
    Views:
    162
    Tony Arcieri
    Dec 8, 2009
Loading...

Share This Page