« Previous Next »

Thread: how to get the # of records from ILogRecordset?

Last post 11-03-2009 5:53 PM by jdelinger. 6 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 10-16-2009, 3:48 PM

    how to get the # of records from ILogRecordset?

    hello all,

    How Do I get the number of records using the code below? rsLP does not have a method for that :(

    LogQueryClassClass LogParser = new LogQueryClassClass(); COMIISW3CInputContextClassClass pObjInput = new COMIISW3CInputContextClassClass();

    ILogRecordset rsLP = LogParser.Execute(query, pObjInput);

    Thank you

     

  • 10-20-2009, 6:53 PM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-14-2006, 3:02 AM
    • Redmond, WA
    • Posts 863

    Re: how to get the # of records from ILogRecordset?

    You have to iterate through all LogRecords and count till end is reached. Something like below:

    while(!rsLP.atEnd())
    {
        count++;
        rsLP.moveNext();
    }

    Thanks,
    Kanwal

    Follow me on twitter at http://twitter.com/kjsingla
  • 10-21-2009, 6:30 PM In reply to

    Re: how to get the # of records from ILogRecordset?

    that is exactly what I am trying NOT to do :)
    I need the total number of records so that I can use that value in a progress bar as I start parsing the logs into a DataTable.

     I just cannot believe there is no method to retrieve that info :(

    Thanks
    J

  • 10-21-2009, 7:28 PM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-14-2006, 3:02 AM
    • Redmond, WA
    • Posts 863

    Re: how to get the # of records from ILogRecordset?

    LogParser doesn't give the count for the same reason. It returns the logrecordset immediately and but the query is actually still processing. As the data is getting produced in the background, you can iterate through the available data.

    Thanks.
    Kanwal

    Follow me on twitter at http://twitter.com/kjsingla
  • 10-28-2009, 7:34 PM In reply to

    Re: how to get the # of records from ILogRecordset?

    that is not good news. I will have to abandon logparser (which I love) and use some other method to import a csv file into a DataTable.

     Thanks

     

  • 10-28-2009, 9:16 PM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-14-2006, 3:02 AM
    • Redmond, WA
    • Posts 863

    Re: how to get the # of records from ILogRecordset?

    How about doing the query twice? Once to get the count(*) and second time to get the actual records?

    Follow me on twitter at http://twitter.com/kjsingla
  • 11-03-2009, 5:53 PM In reply to

    Re: how to get the # of records from ILogRecordset?

    and how would you do that using the LogQuery object?

     

    Thanks

Page 1 of 1 (7 items)
Microsoft Communities