Click here to Skip to main content
15,893,663 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I seriously need some guidance here, I want to create a GUI that displays the columns from the database, allowing the end-user to choose what column he desires to query, once he has chosen his column(s) what does he desire to do with it? for instance it could be a select, update or delete statement, after that, we have to let them make use of the WHERE clause so that they can be more specific about their queries, not only that, we also have to give them the chance to make join queries, so they can select more than one columns, and also they have be able to select specific fields they want to show from their tables.

PLZ give me a starting point, some place where I can begin working this out, or maybe some examples you guys can provide me to give me a better idea on how to start doing this.

By the way this has to be in C#, so I really appreciate any guidance you guys can provide me.

Thank you so much for your time and I hope you guys can help me out on this one.

How can i Create a Query builder? I have a table which i need to query dynamically at run time. I have to choose specific columns from table and query using select and Where ; clause I am a beginner i dont know how to start this work. Plz can anyone help me out.
Posted
Updated 7-Feb-14 3:16am
v2
Comments
ZurdoDev 7-Feb-14 9:17am    
This is a terrible idea. It will be very hard for you to keep it secure. I would suggest thinking of some other way to get the users what they need.
KeyStrokes 7-Feb-14 9:41am    
RyanDev does have a point. However a datq grid my help with this.

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagrid(v=vs.110).aspx

1 solution

You should find this CodeProject article SelectQueryBuilder: Building complex and flexible SQL queries/commands from C#[^] useful. It claims to cover SQL Injection too.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900