public SqlDataBridgeWebPart() { this.Hidden = true; _dataBridge = new SqlDataBridge(); _dataBridge.ExecuteSql += _dataBridge_ExecuteSql; }
void _dataBridge_ExecuteSql(object sender, SqlDataBridge.ExecuteSqlEventArgs e) { string sql = e.Command.CommandText; foreach (SqlParameter param in e.Command.Parameters) sql += String.Format(" {0}='{1}',", param.ParameterName, param.Value ?? ""); this.Monitor.Register(this, this.Monitor.NewEventInstance("execute sql", null, sql, EVENT_TYPE.Trace)); }