C
cenbka
What would be the best approach to following situation:
GridView is bound to ObjectDataSource via DataSourceID pointing to a
processing class. Query to populate ObjectDataSource is based on
user-entered criteria, which is then used in SQL by the method
associated with ObjectDataSource.SelectMethod.
The problem is - user can choose to use several (or none) different
criteria fields. Upon post-back we can custom-tune SelectParameters and
their number, but what do we do with Select method? We can't pass any
classes to it, because Parameter accepts only primitive types (and even
those are in a string format). This leaves us with either declaring
multiple Select methods for all possible number of parameters or encode
all parameters into some class and serialize it to string. Both
approaches seem ugly - any suggestions?
TIA,
Sam
GridView is bound to ObjectDataSource via DataSourceID pointing to a
processing class. Query to populate ObjectDataSource is based on
user-entered criteria, which is then used in SQL by the method
associated with ObjectDataSource.SelectMethod.
The problem is - user can choose to use several (or none) different
criteria fields. Upon post-back we can custom-tune SelectParameters and
their number, but what do we do with Select method? We can't pass any
classes to it, because Parameter accepts only primitive types (and even
those are in a string format). This leaves us with either declaring
multiple Select methods for all possible number of parameters or encode
all parameters into some class and serialize it to string. Both
approaches seem ugly - any suggestions?
TIA,
Sam