Hello,
Thanks for your post on MSDN forum.
It seems that you want to create something like the QueryBuilder of Visual Studio DataSource desiger. The QueryBuilder first display all the tables and views of the database and let the user select which table or view he/she wants to query. After the table is select, it list all the colums and users can select them.
I would like to suggest you take this logic to design your application. You use ADO.NET (SQL Provider) to get all the tables and views and put them into a ListBox control, if one of the tables is selected, list all the columns and let the user to choose the operators to create filters for each colum. Finally, using the select tables, columns and filters to generate the select SQL statement.
Here are some sample for your reference
http://www.codeproject.com/KB/database/SelectQueryBuilder.aspxhttp://www.codeproject.com/KB/database/SQL_Builder.aspxhttp://www.codeproject.com/KB/database/netquerybuilder.aspxThanks,
Rong-Chun Zhang
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact
msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.