SQL string into LLBLGen?

Posts   
 
    
enhesa
User
Posts: 4
Joined: 23-Jul-2008
# Posted on: 30-Jul-2008 14:57:53   

Hello, I'm using LLBLGen Pro 2.6 with ASP.NET 2.0 (C#)

I would like to know if it is possible to query the database using LLBLGen just with a SQL querystring.

so, if the string is

sqlString = "SELECT * FROM Clients"

I want to be able to do something like this

var resultSet = LLBLGenMethod(sqlString)

or even using transactions

var resultSet = LLBLGenMethod(sqlString, transaction)

The point is that I could do this using Entities and filtering them, but I have a lot of sqlStrings all over the place so it will be easier if I can do this on a first stage.

Thanks! Enrique

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 30-Jul-2008 15:13:00   

Why using LLBLGen Pro then? If you would just like to execute some SQL strings, then use conventional ADO.NET

enhesa
User
Posts: 4
Joined: 23-Jul-2008
# Posted on: 31-Jul-2008 11:56:44   

Do I take that answer as a "No, LLBLGen Pro is not able to do this"?

Anyway, answering your question, there is a good reason behind. I'm moving all my DAL to use LLBLGen Pro, so it would be useful to have an unified access to the database using only LLBLGen Pro. This would allow for example to change the connectionString for the whole code with one single line of code, using DbUtils (I need to change very often between databases. Same code, different databases for different clients/environments)

Does anyone know if this feature will be included in next versions of LLBLGen Pro?

Thanks Enrique

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 31-Jul-2008 15:06:25   

As you are migrating your application, I'd recommend you replace the SQL strings with LLBLGen code.

Otherwise if your goal is to use these SQL string to fetch entities then you would have to use RetrievalQuery objects and use projections, to project them back to entityCollections.