performance - How to speed up a LogParser application in ASP.NET -
i've developed asp.net application receives input user sql query ran logparser. (this input kept in "sql1" string. works, works slowly. log file of 60 mb, i've received outofmemory exception. i'm sharing code down below, ideas speed up? there way directly insert ilogrecordset object datagrid, without first converting dataset?
logquery ologquery = new logquery(); comiisw3cinputformat eventlog = new comiisw3cinputformat(); ilogrecord numreq = null; ilogrecordset numset = null; numset = ologquery.execute(sql1, eventlog); datatable querytable = new datatable("query"); (int = 0; < numset.getcolumncount(); i++) { datacolumn col = new datacolumn(); col.columnname = numset.getcolumnname(i); switch (numset.getcolumntype(i)) { case 1: col.datatype = type.gettype("system.int32"); break; case 2: col.datatype = type.gettype("system.double"); break; case 4: col.datatype = type.gettype("system.datetime"); break; default: col.datatype = type.gettype("system.string"); break; } querytable.columns.add(col); } while (!numset.atend()) { numreq = numset.getrecord(); datarow row = querytable.newrow(); (int = 0; < numset.getcolumncount(); i++) row[i] = httpputility.htmlencode(convert.tostring(numreq.getvalue(i))); querytable.rows.add(row); numset.movenext(); } dataset ds = new dataset(); ds.tables.add(querytable); querygrid.datasource = ds; querygrid.databind();
Comments
Post a Comment