Is it possible to use BeforeSelect event for filtering when using a Custom SQL command? Code snippet below.
public override IdhtmlxConnector CreateConnector(HttpContext context){
....
connector = new dhtmlxGridConnector(
sql,
primaryKey,
dhtmlxDatabaseAdapterType.Odbc,
ConfigurationManager.ConnectionStrings["ODBC"].ConnectionString + db_schema,
extra,
false
);
connector.BeforeSelect += new EventHandler(connector_BeforeSelect);
....
}
void connector_BeforeSelect(object sender, EventArgs e)
{
....
// exception because this.Connector.Request.Rules is null
this.Connector.Request.Rules.Add(new FieldRule(var, op, val));
....
}
If this is not possible, is there a way to safely sanitize user input? I’ve used OdbcCommand with parameters [e.g. comm.Paramaters.Add(“@input1”, “%'”)] and hopefully there is a mechanism like this