On Wed, Apr 27, 2011 at 1:30 PM, Richard Kaye <[email protected]> wrote:
> Today I received a pile of data to import in an XML file and wanted to pull 
> it into a cursor so I could manipulate as needed and just thought I'd share 
> this little statistical tidbit.
>
> According to my text editor:
>
> The physical file on disk is 44,689,441 bytes.
> It has 4,656,096 "words".
> It has 1,772,884 lines.
> The data structure in the XML has 6 elements per record; nothing very 
> complicated.
>
> After getting my XMLTOCURSOR syntax worked out, (see the very sophisticated 
> benchmark code sample below; the names have been redacted to protect the 
> innocent...), VFP 9 SP2 took ~18 seconds to parse it and create a cursor with 
> over 220,000 rows
>
> ACTIVATE SCREEN
> CLEAR
> ?DATETIME()
> m.lnStart=SECONDS()
> ?XMLTOCURSOR([<My File To Import>],[<My Result Cursor>],512)
> m.lnEnd=SECONDS()
> ?m.lnEnd-m.lnStart
>
> I wonder how long it would take to parse that file and create an ADO 
> recordset?
------------------------

To read and display in a grid:

string myXMLfile = @"C:\ThatXMLfile.xml";
    DataSet ds = new DataSet();
    // Create new FileStream with which to read the schema.
    System.IO.FileStream fsReadXml = new System.IO.FileStream
        (myXMLfile, System.IO.FileMode.Open);
    try
    {
        ds.ReadXml(fsReadXml);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.ToString());
    }
    finally
    {
        fsReadXml.Close();
    }

    try
    {
        dataGrid1.DataSource = ds;
        dataGrid1.DataMember = "Cust";
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.ToString());
    }
    finally
    {
        
    }


Depending on your disk quality and activity 3-10 seconds to read it.
Putting all that content into a grid, double it. You say about a 1/4
mill rows?


-- 
Stephen Russell

Unified Health Services
60 Germantown Court
Suite 220
Cordova, TN 38018

Telephone: 888.510.2667

901.246-0159 cell

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to