Re: Fill Dataset from csv file

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Cowboy \(Gregory A. Beamer\) [MVP] (NoSpamMgbworld_at_comcast.netNoSpamM)
Date: 06/30/04


Date: Wed, 30 Jun 2004 08:31:42 -0500

I know of no way with the built in capabilities of ADO .NET (will have to
think some more on the problem, as there may be a way). You can use stream
objects to get at the data, but you will likely have to create the arrays to
load it into a DataTable and load each row yourself. You could also load the
CSV into XML (DataSet format) and load in. This can be done from a stream
object, if I remember correctly, but you are still cursing through every row
to set this up.

The issue is this. The ADO .NET providers are set up to pull from a
persistent store, whether it is a database server or a file. There is an
overload to deserilize,
DataSet Constructor (SerializationInfo, StreamingContext), but it is an
internal method. You still end up with a lot of building if you use this
(which is not recommended).

If you temporarily save off the file, you can consume using ADO .NET, which
is simpler. This is not what you desire, however.

-- 
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
************************************************
Think Outside the Box!
************************************************
"andrei" <andrei.toma@era-environmental.com> wrote in message
news:OKEmMEqXEHA.384@TK2MSFTNGP10.phx.gbl...
> Hi Group,
>
> I need to fill a dataset from a csv file. The issue is that the file is
> already loaded in memory
> I'm using an asp.net application to upload a csv file from the user, so
> after submitting, the file is uploaded in the server's memory.
> I don't want to have to save the file on the disk before accessing it.
>
> Is there any way of loading a dataset this way, directly from memory ?
>
> Thank you for any ideas !
>
> Andrei.
>
>


Relevant Pages

  • Re: Help Creating Small Table In Memory
    ... ADO does disconnected recordsets: you can load the ... recordset into memory, ...
    (comp.databases.ms-access)
  • Problem with memory usage (R2009a)
    ... I have a big CSV file that I want to load into memory and ... CSV file is about 25MB and the resulting .mat file is about 10MB. ... during execution memory usage is much higher ...
    (comp.soft-sys.matlab)
  • Re: Tips on finding memory leaks
    ... But when Access reports that it's using 500M of memory, ... The problem is that at least with Access as the front-end, and ADO in the ... mentioned collections and child objects along with ADO. ... what a Recordset is: "A collection of collections contains objects". ...
    (microsoft.public.vb.general.discussion)
  • Re: Recordset.AddNew and the recordset objects data retaining
    ... via an ADO recordset, then I'd strongly suggest you redesign your solution. ... > to do with the updates being in a transaction but rather on whether you specify ... > spill over and the memory starts paging out to disk that concerns me). ...
    (microsoft.public.data.ado)
  • Re: filter with vb code
    ... I guess ADO classic doesn't interest them. ... There may be no recordset in your post be there certainly is a memory ... SQL involving an open workbook causes a memory leak. ...
    (microsoft.public.excel.programming)