This topic is locked
[SOLVED]

 Where clause ignored

6/23/2016 3:52:40 PM
ASPRunner.NET General questions
Pete K author

I am trying to apply a where clause to a report. I have added the following line to the BeforeQueryReport event:

strWhereClause = "Attendee='90001'";


As you can see by the screenshot, it isn't working at all.


Any ideas as to what I might be doing wrong?

Sergey Kornilov admin 6/23/2016

The correct place to add such code is AfterTableInit event. Here is an example:

http://xlinesoft.com/asprunnernet/docs/dynamic_sql_query.htm

Pete K author 6/24/2016



The correct place to add such code is AfterTableInit event. Here is an example:

http://xlinesoft.com...c_sql_query.htm


Thank you Sergey. You might want to change the description of the "Report Page: Before SQL Query" event in ASPRunner.NET. It reads:



Description

Occurs before SQL query executed

Use this event if you like to modify default SQL query on the page.
Parameters

strWhereClause - WHERE clause applied to the SQL query. Example: "active=1"


I spent several frustrating hours messing around with this trying to get it to work.