how the user’s query criteria collected in UI be sent to dhtmlx connector and than feedback on dhtmlx grid?
my scenario (I think it’s very common for most developers):
UI would have a section (at upper) to collect user’s criteria. e.g. txn id, book_name, author,etc.
Then a section at lower would be a data grid. Once user press “Search” button, those records at database matching the criteria would be load into the grid.
It’s seems that it’s a kind of dynamic SQL statement which should be passed to dhtmlx connector.
I think I might use render_sql method. However, I don’t find an example on how to apply it in .NET.
P.S. I have checked most cases in net_dv1 .NET sample and don’t see how to handle dynamic connector SQL statement (Or I should use render_sql at client-side? then what should I set at connector in .ashx?)
Hello,
connectors for .net does not have separate method for dynamic sql.
You may pass query right to the constructor of the connector
gridBasicSQLConnector.ashx:dhtmlxGridConnector connector = new dhtmlxGridConnector(
"SELECT ISO, PrintableName FROM Country",//query
"UID",//primary key
dhtmlxDatabaseAdapterType.SqlServer2005,
ConfigurationManager.ConnectionStrings["SamplesDatabase"].ConnectionString
);
Hello,
yes, it’s possible.
But i don’t think you can use Tools.EscapeQueryValue for the whole query. It escapes single quotes, and you may get an incorrect sql.
e.g. from
Tools.EscapeQueryValue(“SELECT … WHERE name=‘value’”)
you’ll get
SELECT … WHERE name=’‘value’’