I'm trying to implement MS LogParser in a C# application. This compiles fine but inexplicably crashes on the logQuery.ExecuteBatch() method. The try/catch block doesn't catch it unless I specifically malform the szQuery, which suggests that everything is working as it should, I'm just not getting any output.
Any thoughts on why it might be crashing or where I might find some logging?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using FolderLoggingLib; using MSUtil;
namespace ConsoleApplication20 { class Program { static void Main(string[] args) { //refLog = new BinaryInputFormat(); LogQueryClass logQuery = new LogQueryClass(); ICOMCSVOutputContext output = new COMCSVOutputContextClass(); ILogParserInputContext parse = new BinaryInputFormat();
string szFileName = @"E:\Programming\FolderLogging\2012-05-13.fbl"; string szQuery = "SELECT Folder, User, Record, DB, TO_LOCALTIME(Timestamp) AS DateTime, Operation, Checked FROM " + szFileName + " ORDER BY DateTime DESC"; try { logQuery.ExecuteBatch(szQuery, parse, output); } catch { }; } }
}