Generic SQL builder .NET

Posted by Patrick on Stack Overflow See other posts from Stack Overflow or by Patrick
Published on 2010-05-30T10:42:09Z Indexed on 2010/05/30 10:42 UTC
Read the original article Hit count: 135

Filed under:
|
|
|

I'm looking for a way to write an SQL statement in C# targeting different providers. A typical example of SQL statements differentiating is the LIMIT in PostgreSQL vs. TOP in MSSQL.

Is the only way to solve SQL-syntax like the two above to write if-statements depending on which provider the user selects or using try catch statements as flow control (LIMIT didn't work, I'll try TOP instead)? I've seen the LINQ Take method, but I'm wondering if one can do this without LINQ?

In other words, does C# have some generic SQL Provider class that I have failed to find that can be used?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET