Archive for September, 2009

LLBLGen Pro Expressions and Scalar Queries

Tuesday, September 22nd, 2009

Sometimes you need to reproduce monster queries in your code for display specific data or to serve data to reports. In general I prefer to say that “I need certain set of data, so How can I fetch it” instead of “How can I write this query into LLBLGen Pro”. Anyway, sometimes we used to see the data as a result from a query, so it’s helpful to see the query that reproduces the resulset.

Today I will talk about LLBLGen Pro Expressions and how they are useful when building “kind of complex” query constructs like subqueries and make operations among them. I will use IExpression, ScalarQueryExpression and DbFunctionCall within a DynamicList as the target. The code is written in C#, LLBLGen Pro v2.6, Adapter Templaset, using AdvertureWorks DB (SQLServer 2005).

(more…)

Add custom calculated fields to LLBLGen objects

Tuesday, September 8th, 2009

Did you ever wanted to add custom fields to your LLBLGen objects based on some especial expression? Is such expression impossible to build in memory so you want it be query based? Well we will address it a little bit today.

Topics on this post:

When I say LLBLGen objects that means Entities, TypedLists and TypedViews. I wont discuss entities, as Frans explained very well here (see Step 6 – Extending EntityFactory).

So, we will focus on TypedLists and TypedViews. I will use C#, Adapter and AdventureWorks2008 database.

(more…)

Change database name (catalog name) in LLBLGen Designer

Wednesday, September 2nd, 2009

Consider this: you have LLBLGen projects working and everything is just nice, life is beautiful. Then your DBA, for some reason, change the name of the database. How do you manage this as LLBLGen user?

At runtime you can use Catalog Name Overwriting but What about LLBLGen Desinger? How do you refresh changes from your database if the database name changed? Well, this is briefly mentioned at docs, but for some reason users can’t figure this out, so I will try to explain it a little bit more.

(more…)