G
Guest
I'm trying to dynamicaly change Where conditions in a Datagrid without success.
The aspx form has some input fields, used to build the search, plus a final
SEARCH button. In the click event I build the SQL Select stmt and do the
following:
Me.DataSourceSearch.SelectCommand = "SELECT ... WHERE ...."
Me.gridResult.DataBind()
The datagrid has been designed with a generic SELECT command like "SELECT *
FROM Mytable", that in my supposing should be overwritten by the
..SelectCommand stmt.
Problem: Clickng the Search button I get a correct first page Datagrid, but
paging I then get data without any Where condition set.
I've tryed many other ways without success. Where is my fault?
Many thanks.
The aspx form has some input fields, used to build the search, plus a final
SEARCH button. In the click event I build the SQL Select stmt and do the
following:
Me.DataSourceSearch.SelectCommand = "SELECT ... WHERE ...."
Me.gridResult.DataBind()
The datagrid has been designed with a generic SELECT command like "SELECT *
FROM Mytable", that in my supposing should be overwritten by the
..SelectCommand stmt.
Problem: Clickng the Search button I get a correct first page Datagrid, but
paging I then get data without any Where condition set.
I've tryed many other ways without success. Where is my fault?
Many thanks.