G
Guest
I'm using VS2005, VB, WinForms
I’ve developed forms using those nice wizards Microsoft provides. However,
I’m running into a couple of complications trying to work with the resulting
Table Adapters.
1) My user interface allows the user to fill in any combination of perhaps a
dozen Query-By-Example (QBE) fields, and then press a Query button to
generate a list, based on an SQL statement that incorporates those QBE
fields. The list is presented in a DataGridView.
I have ancestor code to generate a full SQL statement based on any
combination of QBE fields entered, including handling typical search symbols
(>, <=, *, etc.). How do I get the generated SQL into a Table Adapter Query?
It looks like Table Adapter Queries are designed to be set up only at design
time (?). I’ve tried to put the whole Where clause into a Parameter, but
this fails. Since the user can enter any combination of the 12 QBE fields it
is impractical to set up Queries to handle all possibilities at design time.
2) I’d like to pass the Table Adapter to parent objects (ancestors in the
same class) for generic save processing. Apparently, Table Adapters can’t be
defined any more precisely than as an Object (?), so I don’t see how to
assign them to an object variable that I can work with in the Ancestor.
So, do I forgo the lovely wizard and build my forms more from scratch, or
can I make Table Adapters flexible enough to handle my requirements?
I’ve developed forms using those nice wizards Microsoft provides. However,
I’m running into a couple of complications trying to work with the resulting
Table Adapters.
1) My user interface allows the user to fill in any combination of perhaps a
dozen Query-By-Example (QBE) fields, and then press a Query button to
generate a list, based on an SQL statement that incorporates those QBE
fields. The list is presented in a DataGridView.
I have ancestor code to generate a full SQL statement based on any
combination of QBE fields entered, including handling typical search symbols
(>, <=, *, etc.). How do I get the generated SQL into a Table Adapter Query?
It looks like Table Adapter Queries are designed to be set up only at design
time (?). I’ve tried to put the whole Where clause into a Parameter, but
this fails. Since the user can enter any combination of the 12 QBE fields it
is impractical to set up Queries to handle all possibilities at design time.
2) I’d like to pass the Table Adapter to parent objects (ancestors in the
same class) for generic save processing. Apparently, Table Adapters can’t be
defined any more precisely than as an Object (?), so I don’t see how to
assign them to an object variable that I can work with in the Ancestor.
So, do I forgo the lovely wizard and build my forms more from scratch, or
can I make Table Adapters flexible enough to handle my requirements?