C# Sql Query Designer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Okay, how I get myself into these situations, I don't know, but I have to
design a component to plug into a C# Windows Forms application that allows
the user to design a sql query. I'm thinking of something like the view
designer in Enterprise Manager.

Does anyone have any idea if there are any third party components that I can
use, or have any suggestions on implementation. I've taken a cursory look for
available components but haven't found any. I'm to worried about interface,
or even building the query, it's going to be the parsing of the query that
will be a nightmare, any ideas around that would be helpful to.

And if anyone says why don't you have the user just use Enterprise Manager,
I'm going to crap myself.
 
And if anyone says why don't you have the user just use Enterprise
Manager, I'm going to crap myself.

Well this is just a thought, but it might make you half-crap. Visual
Studio integrates the same controls that Enterprise Manager uses to design
queries and such, which means that it is most likely COM objects that
actually do the work. You could use the same COM objects, but it probably
relies on Enterprise Manager being installed. Not only that, but it
probably would be modifying the database queries instead of just producing
a result that your system can use - probably not what you want.

As a real answer to your question, it shouldn't be that difficult (in
theory anyway - probably more so in practice) to use SQLDMO to read the
database table definitions, and then allow the user to link fields together
from different tables, specify which fields he wants to retrieve, and then
produce a SQL Query from that. If you are decent with SQL commands then
building the query is probably the easy part... the user interface would
probably be the most difficult part to implement.
 
Back
Top