Generated Sql query ?

Posts   
 
    
lsdev
User
Posts: 4
Joined: 16-Jul-2007
# Posted on: 16-Jul-2007 17:14:41   

I use LLBLGen with a template selfServicing.

I had to generate a query with joins.


ResultsetFields fields = new ResultsetFields(3);
fields.DefineField(TOffresFields.IdOffre, 0);
fields.DefineField(TClientsFields.StrCli, 1);
fields.DefineField(FactFields.Montant, 2);

IRelationCollection join = new RelationCollection();
IEntityRelation relation = new EntityRelation();
relation.AddEntityFieldPair( TOffresFields.StrClient,TClientsFields.StrClient);
join.Add(relation, JoinHint.Right);     
            
relation = new EntityRelation();
relation.AddEntityFieldPair(TOffresFields.IdsOffre, FactFields.idsOffre);
join.Add(relation, JoinHint.Left);

DataTable dynamicList = new DataTable();
TypedListDAO dao = new TypedListDAO();
dao.GetMultiAsDataTable(fields, dynamicList, 0, null, null, join, false, null, null, 0, 0);

The result of the query is not as expected. To debug this, I would see the generated sql query. Unfortunately, I don't know how to get this with a dao object. It's not as a GetMulti on a collection.

Thanks for help and sorry if i don't write well english.

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 16-Jul-2007 19:48:01   

the crudest way to view the generated queries is to enable the LLBL tracers and watch the Output window.

place this in the app/web.config.


  <system.diagnostics>
    <switches>
      <add name="SqlServerDQE" value="4" />
      <add name="ORMGeneral" value="4" />
      <add name="ORMPersistenceExecution" value="4" />
    </switches>
  </system.diagnostics>

for more information search for tracing in the help docs

lsdev
User
Posts: 4
Joined: 16-Jul-2007
# Posted on: 19-Jul-2007 10:29:19   

thank you very much for this help...