Esempio n. 1
0
        public AddTraceFilterErrorCode AddTraceFilter <T>(TraceField traceField, LogicalOperator logicalOp, ComparisonOperator compOp, T value)
        {
            if (traceId == 0)
            {
                throw new NotInitializedProfilerException();
            }

            SqlCommand cmd = MsSqlUtil.NewStoredProcedure("sp_trace_setfilter");

            MsSqlUtil.AddInParam(cmd, "@traceid", traceId);
            MsSqlUtil.AddInParam(cmd, "@columnid", (int)traceField);
            MsSqlUtil.AddInParam(cmd, "@logical_operator", (int)logicalOp);
            MsSqlUtil.AddInParam(cmd, "@comparison_operator", (int)compOp);
            MsSqlUtil.AddInParam(cmd, "@value", value);
            return((AddTraceFilterErrorCode)MsSqlUtil.ExecuteStoredProcedure(cmd, connInfo.CreateConnectionObject()));
        }
        public void Test1()
        {
            TraceField[] traceFields = new TraceField[] { TraceField.ApplicationName, TraceField.TextData, TraceField.StartTime, TraceField.Reads, TraceField.LoginSID };

            profiler.AddTraceEvent(TraceEvent.RPCCompleted, traceFields);
            profiler.AddTraceEvent(TraceEvent.RPCStarting, traceFields);
            profiler.AddTraceEvent(TraceEvent.SQLBatchCompleted, traceFields);
            profiler.AddTraceEvent(TraceEvent.SQLBatchStarting, traceFields);

            profiler.AddTraceFilter(TraceField.TextData, LogicalOperator.AND, ComparisonOperator.NotEqual, "sdsd");

            profiler.TraceEvent += new EventHandler <TraceEventArgs>(profiler_TraceEvent);
            profiler.Start();

            re.WaitOne(new TimeSpan(0, 0, 10), true);
            profiler.Stop();
        }
        public void Test1()
        {
            TraceField[] traceFields = new TraceField[] {TraceField.ApplicationName, TraceField.TextData, TraceField.StartTime, TraceField.Reads, TraceField.LoginSID};

            profiler.AddTraceEvent(TraceEvent.RPCCompleted, traceFields);
            profiler.AddTraceEvent(TraceEvent.RPCStarting, traceFields);
            profiler.AddTraceEvent(TraceEvent.SQLBatchCompleted, traceFields);
            profiler.AddTraceEvent(TraceEvent.SQLBatchStarting, traceFields);

            profiler.AddTraceFilter(TraceField.TextData, LogicalOperator.AND, ComparisonOperator.NotEqual, "sdsd");

            profiler.TraceEvent += new EventHandler<TraceEventArgs>(profiler_TraceEvent);
            profiler.Start();

            re.WaitOne(new TimeSpan(0,0, 10), true);
            profiler.Stop();
        }
 public FilterProperties(TraceField field, ComparisonOperator op, string value)
 {
     _field = field;
     _op    = op;
     _value = value;
 }
 public FilterProperties(TraceField field, ComparisonOperator op, string value)
 {
     _field = field;
     _op = op;
     _value = value;
 }