Hi all I am trying to use the logparser vis COM using c# code . I am usign a function pareLog which returns a dataset after querying the TSV file . Lets say I have a data which looks like this :
Field1 Field2
Data1 Da'ta2nsomemore
Notice the single quote in the data under field2.Now my query looks something like this :
string strSQL = "select * from 'C:\20091014_ErrorLogs.log' where Field2 like '%Da'ta'";
Dataset DS = parselog(strsql);
the parselog function i am using from the following link :
http://www.leastprivilege.com/UsingLogParserFromC.aspx
obviously the above query is throwing an exception since anything after the second single quote in the where condition is taken as a part of the query. So how to tackle this problem ? Any help greatly appreciated.