views:

132

answers:

2

Something like this.

http://code.google.com/p/squiggle-sql/wiki/Tutorial.

This is required for cases where It is required to build complex sql from the user input from UI. Currently in the project I am working is using String Manipulation which looks ugly and is difficult to maintain.

+1  A: 

I always build my own... it's quick and easy and you don't have to rely on 3rd-party libraries. Plus it helps you become that little bit more intimate with SQL.

Michael Rodrigues
That's true if you're a programmer, but I can see that library being used to drive a GUI that allows non-programmers/data entry people to build generic queries against a database. They're never going to be able to do so *efficiently* but sometimes it's useful.
Dean Harding
A: 

Not that I am aware of (although that doesn't mean there definitely isn't).

What about Entity Framework? It allows the query to be built up and translates that to SQL against entities:

customers.OrderBy(c => c.Name).Skip(10).Take(20) 

Generates:

SELECT value c 
FROM NW.Customers AS c 
ORDER BY c.Name skip 10 limit 20; 
Michael Shimmins
The application I am working on is in .Net 2.0. So EF is not an option for me.
Amitabh
Can you use a full blown orm such as NHibernate? It will give you the ability to build I queries through it'd Criteria API.
Michael Shimmins
We are using nHibernate 1.2 in our application but this particular functionality has bypassed nHibernate for performance reasons.
Amitabh